X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Ffk.autocomplete.js;h=b1bc40be28b12f4bf99c418a044396120ee80c61;hb=ca21f1bbc81ee2f9118995f26d31270d41dd46eb;hp=69fe77e8cb2f7762eb81f46f58f56bac709a1a1a;hpb=395a9530dcbca95b2f2c7dde9df21ee1981fa19f;p=friendica.git diff --git a/js/fk.autocomplete.js b/js/fk.autocomplete.js old mode 100755 new mode 100644 index 69fe77e8cb..b1bc40be28 --- a/js/fk.autocomplete.js +++ b/js/fk.autocomplete.js @@ -14,22 +14,22 @@ function ACPopup(elm,backend_url){ this.kp_timer = false; this.url = backend_url; + var w = 530; + var h = 130; + + if(typeof elm.editorId == "undefined") { style = $(elm).offset(); w = $(elm).width(); h = $(elm).height(); } else { - style = $(elm.container).offset(); - w = elm.container.offsetWidth; - h = elm.container.offsetHeight; - // Quick fix for chrome until I get a tool to inspect the dom - // Chrome returns 0x0 - if(! w) - w = 530; - if(! h) - h = 130; - + var container = elm.getContainer(); + if(typeof container != "undefined") { + style = $(container).offset(); + w = $(container).width(); + h = $(container).height(); + } } style.top=style.top+h; @@ -104,7 +104,7 @@ ACPopup.prototype._search = function(){ else { txt = tinyMCE.activeEditor.getContent(); // alert(that.searchText + ':' + t); - newtxt = txt.replace(that.searchText,t+' '); + newtxt = txt.replace('@' + that.searchText,'@' + t +' '); tinyMCE.activeEditor.setContent(newtxt); tinyMCE.activeEditor.focus(); that.close();