mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dropabble minor performance changes
This commit is contained in:
parent
c400e02621
commit
a14c917e8e
@ -28,7 +28,7 @@ $.widget("ui.droppable", {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Store the droppable's proportions
|
//Store the droppable's proportions
|
||||||
this.proportions = { width: this.element.outerWidth(), height: this.element.outerHeight() };
|
this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
|
||||||
|
|
||||||
// Add the reference and positions to the manager
|
// Add the reference and positions to the manager
|
||||||
$.ui.ddmanager.droppables.push(this);
|
$.ui.ddmanager.droppables.push(this);
|
||||||
@ -177,11 +177,10 @@ $.ui.ddmanager = {
|
|||||||
var m = $.ui.ddmanager.droppables;
|
var m = $.ui.ddmanager.droppables;
|
||||||
var type = e ? e.type : null; // workaround for #2317
|
var type = e ? e.type : null; // workaround for #2317
|
||||||
for (var i = 0; i < m.length; i++) {
|
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;
|
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.is(":visible"); if(!m[i].visible) continue; //If the element is not visible, continue
|
||||||
m[i].offset = m[i].element.offset();
|
m[i].offset = m[i].element.offset();
|
||||||
m[i].proportions = { width: m[i].element.outerWidth(), height: m[i].element.outerHeight() };
|
m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
|
||||||
|
|
||||||
if(type == "dragstart" || type == "sortactivate") m[i].activate.call(m[i], e); //Activate the droppable if used directly from draggables
|
if(type == "dragstart" || type == "sortactivate") m[i].activate.call(m[i], e); //Activate the droppable if used directly from draggables
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user