Update library

This commit is contained in:
YUKI Hiroshi 2015-11-04 11:45:08 +09:00
parent 0fbea3cfbf
commit e8941963d4

View File

@ -15,7 +15,7 @@
http://github.com/piroor/fxaddonlib-tabs-drag-utils http://github.com/piroor/fxaddonlib-tabs-drag-utils
*/ */
(function() { (function() {
const currentRevision = 33; const currentRevision = 34;
if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
@ -159,17 +159,32 @@
{ {
this.updatedTabDNDObservers.push(aObserver); this.updatedTabDNDObservers.push(aObserver);
if ('_setEffectAllowedForDataTransfer' in aObserver && if (typeof aObserver._setEffectAllowedForDataTransfer === 'function') { // Firefox 43 and older
aObserver._setEffectAllowedForDataTransfer.toSource().indexOf('tabsDragUtils') < 0) { if (aObserver._setEffectAllowedForDataTransfer.toSource().indexOf('tabsDragUtils') < 0) {
let original = aObserver._setEffectAllowedForDataTransfer; let original = aObserver._setEffectAllowedForDataTransfer;
aObserver.__TabsDragUtils_original__setEffectAllowedForDataTransfer = original; aObserver.__TabsDragUtils_original__setEffectAllowedForDataTransfer = original;
eval('aObserver._setEffectAllowedForDataTransfer = '+ eval('aObserver._setEffectAllowedForDataTransfer = '+
original.toSource().replace( original.toSource().replace(
'dt.mozItemCount > 1', 'dt.mozItemCount > 1',
'$& && !window["piro.sakura.ne.jp"].tabsDragUtils.isTabsDragging(arguments[0])' '$& && !window["piro.sakura.ne.jp"].tabsDragUtils.isTabsDragging(arguments[0])'
) )
); );
aObserver.__TabsDragUtils_updated__setEffectAllowedForDataTransfer = aObserver._setEffectAllowedForDataTransfer; aObserver.__TabsDragUtils_updated__setEffectAllowedForDataTransfer = aObserver._setEffectAllowedForDataTransfer;
}
}
else { // Firefox 44 and later
if (typeof aObserver._getDropEffectForTabDrag === 'function' &&
aObserver._getDropEffectForTabDrag.toSource().indexOf('tabsDragUtils') < 0) {
let original = aObserver._getDropEffectForTabDrag;
aObserver.__TabsDragUtils_original__getDropEffectForTabDrag = original;
eval('aObserver._getDropEffectForTabDrag = '+
original.toSource().replace(
'dt.mozItemCount > 1',
'$& && !window["piro.sakura.ne.jp"].tabsDragUtils.isTabsDragging(arguments[0])'
)
);
aObserver.__TabsDragUtils_updated__getDropEffectForTabDrag = aObserver._getDropEffectForTabDrag;
}
} }
if ('_animateTabMove' in aObserver && if ('_animateTabMove' in aObserver &&
@ -573,6 +588,11 @@
if (!aObserver) if (!aObserver)
return; return;
if (aObserver._getDropEffectForTabDrag == aObserver.__TabsDragUtils_updated__getDropEffectForTabDrag)
aObserver._getDropEffectForTabDrag = aObserver.__TabsDragUtils_original__getDropEffectForTabDrag;
delete aObserver.__TabsDragUtils_original__getDropEffectForTabDrag;
delete aObserver.__TabsDragUtils_updated__getDropEffectForTabDrag;
if (aObserver._setEffectAllowedForDataTransfer == aObserver.__TabsDragUtils_updated__setEffectAllowedForDataTransfer) if (aObserver._setEffectAllowedForDataTransfer == aObserver.__TabsDragUtils_updated__setEffectAllowedForDataTransfer)
aObserver._setEffectAllowedForDataTransfer = aObserver.__TabsDragUtils_original__setEffectAllowedForDataTransfer; aObserver._setEffectAllowedForDataTransfer = aObserver.__TabsDragUtils_original__setEffectAllowedForDataTransfer;
delete aObserver.__TabsDragUtils_original__setEffectAllowedForDataTransfer; delete aObserver.__TabsDragUtils_original__setEffectAllowedForDataTransfer;