X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=roojs-ui-debug.js;h=f1c5c749ef8f557486044df98e7699b742d9b486;hp=eccdb83658e890ac479d6f9e7e3f84c39120ecd5;hb=e28295d9bf2622b5292557e0935b71b03f537647;hpb=f2689269a2a28287e338dbca978ed7bbeaf2c060 diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index eccdb83658..f1c5c749ef 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -27749,16 +27749,42 @@ Roo.form.HtmlEditor.ToolbarStandard.prototype = { createLink : function(){ //Roo.log("create link?"); var ec = this.editorcore; - (function() { - Roo.MessageBox.prompt("Add Link URL",this.createLinkText, function(btn, url) { - if (btn != 'ok') { - return; - } - if(url && url != 'http:/'+'/'){ - ec.relayCmd('createlink', url); - } + var ar = ec.getAllAncestors(); + var n = false; + for(var i = 0;i< ar.length;i++) { + if (ar[i] && ar[i].nodeName == 'A') { + n = ar[i]; + break; + } + } + + (function() { + + Roo.MessageBox.show({ + title : "Add / Edit Link URL", + msg : "Enter the url for the link", + buttons: Roo.MessageBox.OKCANCEL, + fn: function(btn, url){ + if (btn != 'ok') { + return; + } + if(url && url != 'http:/'+'/'){ + if (n) { + n.setAttribute('href', url); + } else { + ec.relayCmd('createlink', url); + } + } + }, + minWidth:250, + prompt:true, + //multiline: multiline, + modal : true, + value : n ? n.getAttribute('href') : '' }); - }).defer(100, this); // we have to defer this , otherwise the mouse click gives focus to the main window. + + + }).defer(100, this); // we have to defer this , otherwise the mouse click gives focus to the main window. },