]> git.mxchange.org Git - friendica.git/commitdiff
make autocomplete work with updated tinymce
authorfriendica <info@friendica.com>
Wed, 21 Mar 2012 12:27:08 +0000 (05:27 -0700)
committerfriendica <info@friendica.com>
Wed, 21 Mar 2012 12:27:08 +0000 (05:27 -0700)
js/fk.autocomplete.js

index 69fe77e8cb2f7762eb81f46f58f56bac709a1a1a..b1db92c41447df473747736f08b68c8d856cad31 100755 (executable)
@@ -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;