Roo/form/HtmlEditor/ToolbarStandard.js
authorAlan <alan@roojs.com>
Tue, 18 Jan 2022 03:32:06 +0000 (11:32 +0800)
committerAlan <alan@roojs.com>
Tue, 18 Jan 2022 03:32:06 +0000 (11:32 +0800)
Roo/form/HtmlEditor/ToolbarStandard.js

index aea4d75..d72555f 100644 (file)
@@ -526,14 +526,16 @@ Roo.form.HtmlEditor.ToolbarStandard.prototype = {
     createLink : function(){
         //Roo.log("create link?");
         var ec = this.editorcore;
-        Roo.MessageBox.prompt("Add Link URL",this.createLinkText, function(btn, url) {
-            if (btn != 'ok') {
-                return;
-            }
-            if(url && url != 'http:/'+'/'){
-                ec.relayCmd('createlink', url);
-            }
-        });
+        (function() { 
+            Roo.MessageBox.prompt("Add Link URL",this.createLinkText, function(btn, url) {
+                if (btn != 'ok') {
+                    return;
+                }
+                if(url && url != 'http:/'+'/'){
+                    ec.relayCmd('createlink', url);
+                }
+            });
+    }).defer(100, this); // we have to defer this , otherwise the mouse click gives focus to the main window.
         
     },