Merge pull request #345 from Infocatcher/patch-8

Optimize setAttribute/removeAttribute usage during DragOver (v.2)
This commit is contained in:
YUKI "Piro" Hiroshi 2012-08-29 02:58:04 -07:00
commit 5a08ebf666

View File

@ -853,12 +853,11 @@ try{
}
}
this.clearDropPosition();
if (
!info.canDrop ||
observer._setEffectAllowedForDataTransfer(aEvent) == 'none'
) {
this.clearDropPosition();
aEvent.dataTransfer.effectAllowed = "none";
return true;
}
@ -870,12 +869,16 @@ try{
if (tab) indicatorTab = tab;
}
indicatorTab.setAttribute(
sv.kDROP_POSITION,
info.position == sv.kDROP_BEFORE ? 'before' :
let dropPos = info.position == sv.kDROP_BEFORE ? 'before' :
info.position == sv.kDROP_AFTER ? 'after' :
'self'
);
'self';
if (indicatorTab.getAttribute(sv.kDROP_POSITION) != dropPos) {
this.clearDropPosition();
indicatorTab.setAttribute(sv.kDROP_POSITION, dropPos);
}
var indicator = b.mTabDropIndicatorBar || b.tabContainer._tabDropIndicator;
indicator.setAttribute('dragging', (info.position == sv.kDROP_ON || sv.isVertical) ? 'false' : 'true' );