Skip to content

Commit a14c917

Browse files
Dropabble minor performance changes
1 parent c400e02 commit a14c917

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ui/ui.droppable.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $.widget("ui.droppable", {
2828
});
2929

3030
//Store the droppable's proportions
31-
this.proportions = { width: this.element.outerWidth(), height: this.element.outerHeight() };
31+
this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
3232

3333
// Add the reference and positions to the manager
3434
$.ui.ddmanager.droppables.push(this);
@@ -177,11 +177,10 @@ $.ui.ddmanager = {
177177
var m = $.ui.ddmanager.droppables;
178178
var type = e ? e.type : null; // workaround for #2317
179179
for (var i = 0; i < m.length; i++) {
180-
181180
if(m[i].options.disabled || (t && !m[i].options.accept.call(m[i].element,(t.currentItem || t.element)))) continue;
182181
m[i].visible = m[i].element.is(":visible"); if(!m[i].visible) continue; //If the element is not visible, continue
183182
m[i].offset = m[i].element.offset();
184-
m[i].proportions = { width: m[i].element.outerWidth(), height: m[i].element.outerHeight() };
183+
m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
185184

186185
if(type == "dragstart" || type == "sortactivate") m[i].activate.call(m[i], e); //Activate the droppable if used directly from draggables
187186
}

0 commit comments

Comments
 (0)