fix #7610 - 206_minor_fixes_to_portal
[roojs1] / Roo / bootstrap / form / HtmlEditorToolbar / Standard.js
index 1ae9854..1fb81fc 100644 (file)
@@ -253,12 +253,13 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp
         var reader = new FileReader();
         reader.addEventListener('load', (function() {
             if (bl) {
+                var oldSrc = bl.image_src;
                 bl.image_src = reader.result;
                 //bl.caption = f.name;
                 bl.updateElement(sn);
                 this.editor.syncValue();
                 editor.owner.fireEvent('editorevent', editor.owner, false);
-                editor.owner.fireEvent('imageupdate', editor.owner, sn);
+                editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc);
                 // we only do the first file!! and replace.
                 return;
             }
@@ -274,10 +275,11 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp
             }
             // just a standard img..
             if (sn && sn.tagName.toUpperCase() == 'IMG') {
+                var oldSrc = sn.src;
                 sn.src = reader.result;
                 this.editor.syncValue();
                 editor.owner.fireEvent('editorevent', editor.owner, false);
-                editor.owner.fireEvent('imageupdate', editor.owner, sn);
+                editor.owner.fireEvent('imageupdate', editor.owner, sn, oldSrc);
                 return;
             }
             editor.insertAtCursor('<img src="' + reader.result +'">');
@@ -317,13 +319,15 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp
                 }
                 if (url != '') {
                     this.selectedNode.setAttribute('href', newurl);
+                    this.editor.syncValue();
                     return;
                 }
                 if(newurl && newurl .match(/http(s):\/\/.+/)) {
                     this.editorcore.relayCmd('createlink', newurl);
                 }
                 this.editorcore.focus();
-            }
+            },
+            cls : this.editorcore.linkDialogCls
         });
     },
     /**