]> source.dussan.org Git - jquery-ui.git/commitdiff
droppable: a small performance improvement by not using :visible, and deferring to...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 3 Jul 2008 13:05:30 +0000 (13:05 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 3 Jul 2008 13:05:30 +0000 (13:05 +0000)
ui/ui.droppable.js

index b8bac826e474e808795003e5dd80fe81440c36a1..5f208afa354d6a521745a1fc0ad3348036a4a18d 100644 (file)
@@ -176,9 +176,10 @@ $.ui.ddmanager = {
                
                var m = $.ui.ddmanager.droppables;
                var type = e ? e.type : null; // workaround for #2317
+
                for (var i = 0; i < m.length; i++) {
                        if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element,(t.currentItem || t.element)))) continue;
-                       m[i].visible = m[i].element.is(":visible"); if(!m[i].visible) continue; //If the element is not visible, continue
+                       m[i].visible = m[i].element.css("display") == "none"; if(!m[i].visible) continue; //If the element is not visible, continue
                        m[i].offset = m[i].element.offset();
                        m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
                        
@@ -210,6 +211,7 @@ $.ui.ddmanager = {
                if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, e);
                
                //Run through all droppables and check their positions based on specific tolerance options
+
                $.each($.ui.ddmanager.droppables, function() {
                        
                        if(this.options.disabled || this.greedyChild || !this.visible) return;