Skip to content

Commit

Permalink
droppable: a small performance improvement by not using :visible, and…
Browse files Browse the repository at this point in the history
… deferring to a simpler syntax of checking for diplay none
  • Loading branch information
Paul Bakaus committed Jul 3, 2008
1 parent 6e75723 commit 6aaf159
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/ui.droppable.js
Expand Up @@ -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 };

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6aaf159

Please sign in to comment.