X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=js%2Ffk.autocomplete.js;h=509466bd9878f3810cadc00259af22db3bdc7198;hb=c47bae7a5f1ec1ee7966369dc0c9693564670065;hp=6a1f1965aa9b429ab357f10bf1cacd3f479c50e1;hpb=2d22a58324194ebb37b042658db5a8fc2d94b3a7;p=friendica.git diff --git a/js/fk.autocomplete.js b/js/fk.autocomplete.js old mode 100644 new mode 100755 index 6a1f1965aa..509466bd98 --- a/js/fk.autocomplete.js +++ b/js/fk.autocomplete.js @@ -1,5 +1,5 @@ /** - * Friendika people autocomplete + * Friendica people autocomplete * * require jQuery, jquery.textareas */ @@ -13,20 +13,35 @@ function ACPopup(elm,backend_url){ this.ready=true; this.kp_timer = false; this.url = backend_url; - - style = $(elm).offset(); - w = $(elm).width(); - h = $(elm).height(); + + 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; + + } + style.top=style.top+h; style.width = w; style.position = 'absolute'; -/* style['max-height'] = '150px'; - style.border = '1px solid red'; - style.background = '#cccccc'; + /* style['max-height'] = '150px'; + style.border = '1px solid red'; + style.background = '#cccccc'; - style.overflow = 'auto'; - style['z-index'] = '100000'; -*/ + style.overflow = 'auto'; + style['z-index'] = '100000'; + */ style.display = 'none'; this.cont = $("
"); @@ -65,7 +80,7 @@ ACPopup.prototype._search = function(){ that.cont.show(); $(data.items).each(function(){ html = "{1} ({2})".format(this.photo, this.name, this.nick) - that.add(html, this.nick + ' - ' + this.link); + that.add(html, this.nick.replace(' ','') + '+' + this.id + ' - ' + this.link); }); } else { that.cont.hide(); @@ -74,23 +89,36 @@ ACPopup.prototype._search = function(){ }); } -ACPopup.prototype.add = function(label, value){ + ACPopup.prototype.add = function(label, value){ var that=this; var elm = $("