Roo/bootstrap/form/HtmlEditorToolbar/Standard.js
authorAlan <alan@roojs.com>
Thu, 16 Feb 2023 08:25:08 +0000 (16:25 +0800)
committerAlan <alan@roojs.com>
Thu, 16 Feb 2023 08:25:08 +0000 (16:25 +0800)
Roo/bootstrap/form/HtmlEditorToolbar/Standard.js

index f48f8dd..2ac8204 100644 (file)
@@ -154,13 +154,16 @@ Roo.extend(Roo.bootstrap.form.HtmlEditorToolbar.Standard, Roo.bootstrap.nav.Simp
                 multiline: false,
                 modal : true,
                 value : url,
-                fn:  function(pressed, url) {
+                fn:  function(pressed, newurl) {
                     if (pressed != 'ok') {
                         return;
                     }
-                    
-                    if(url && url.match(/http(s):\/\/.+/)) {
-                        this.editorcore.relayCmd('createlink', url);
+                    if (url != '') {
+                        this.selectedNode.setAttribute('href', newurl);
+                        return;
+                    }
+                    if(newurl && newurl .match(/http(s):\/\/.+/)) {
+                        this.editorcore.relayCmd('createlink', newurl );
                     }
                 }
             });