Ignore:
Timestamp:
Sep 23, 2010, 1:41:33 PM (14 years ago)
Author:
cljosse
Message:

[Autosize]Improvement mootools compatibility


File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/js/Affiche_script.js

    r7008 r7009  
    2727        tp1 = typeof(MooTools);
    2828        if (tp1 != "undefined") {
    29          if (MooTools.version=="1.2.4" || MooTools.version=="1.11")
    30             return jQuery(new_element).get(0);
     29            if (MooTools.version == "1.2.4" || MooTools.version == "1.11")
     30            //==== mootools prototype ====
     31                B = element;
     32                if (!B) { return null; }
     33                if (B.htmlElement) {
     34                    return Garbage.collect(B);
     35
     36                }
     37                if ([window, document].contains(B)) { return B; }
     38                var A = $type(B);
     39                if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
     40                if (A != "element") {
     41                    return null;
     42                }
     43                if (B.htmlElement) { return Garbage.collect(B); }
     44                if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
     45                $extend(B, Element.prototype);
     46                B.htmlElement = function () { };
     47                return Garbage.collect(B);
     48           
     49           // return jQuery(element).get(0);
    3150        }
    3251        tp1 = typeof(Prototype);
Note: See TracChangeset for help on using the changeset viewer.