From c6ac8d824393a195dd83717064b1468d9ba97d7d Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Mon, 12 Apr 2010 12:05:40 +0000 Subject: [PATCH] Merged BRANCHES/DEV/BELARUS/HEAD-2010_01_11 to HEAD (with modifications) 18309: ALF-514 & ALF-775: Changes not being applied during online modification of Web Content in WebKit based browsers git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19817 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/web/scripts/ajax/xforms.js | 39 ++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js index add6ae8a1b..66f53a0784 100644 --- a/source/web/scripts/ajax/xforms.js +++ b/source/web/scripts/ajax/xforms.js @@ -934,8 +934,18 @@ alfresco.xforms.RichTextEditor = alfresco.xforms.Widget.extend({ tinyMCE.execCommand("mceAddControl", false, this.widget.id) var editorDocument = tinyMCE.get(this.widget.id).getDoc(); editorDocument.widget = this; - tinymce.dom.Event.add(editorDocument,window.ie ? "mouseout" : "blur", - this._tinyMCE_blurHandler); + + if (navigator.userAgent.contains('Safari')) + { + // ETHREEOH-2568 bug fixing + this.domNode.onmouseout = this._tinyMCE_blurHandler.bindAsEventListener(this); + } + else + { + tinymce.dom.Event.add(editorDocument,window.ie ? "mouseout" : "blur", + this._tinyMCE_blurHandler); + } + tinymce.dom.Event.add(editorDocument, "focus", this._tinyMCE_focusHandler); this._created = true; }, @@ -1053,11 +1063,24 @@ alfresco.xforms.RichTextEditor = alfresco.xforms.Widget.extend({ _tinyMCE_blurHandler: function(event) { + var widget; if (event.type == "mouseout") { - event.target = event.srcElement.ownerDocument; + if (window.ie) + { + event.target = event.srcElement.ownerDocument; + widget = event.target.widget; + } + else + { + widget = this; + } } - var widget = event.target.widget; + else + { + widget = event.target.widget; + } + var value = widget.getValue(); if (value != widget._oldValue) { @@ -4350,10 +4373,10 @@ alfresco.xforms.XForm = new Class({ /** sets the repeat indexes by calling XFormsBean.setRepeatIndeces. */ setRepeatIndeces: function(repeatIndeces) { - // The following debug statement is causing performance and rendering issues (ETWOTWO-1006, - // ETHREEOH-3155 & ETHREEOH-2653), only uncomment this line if necessary for fault finding. - // alfresco.log("setting repeat indeces [" + repeatIndeces.join(", ") + "]"); - + // The following debug statement is causing performance and rendering issues (ETWOTWO-1006, + // ETHREEOH-3155 & ETHREEOH-2653), only uncomment this line if necessary for fault finding. + // alfresco.log("setting repeat indeces [" + repeatIndeces.join(", ") + "]"); + var params = { }; params["repeatIds"] = []; for (var i = 0; i < repeatIndeces.length; i++)