Update tabsDragUtils to the latest revision
This commit is contained in:
parent
4797ddfb6b
commit
3f59db7448
@ -15,7 +15,7 @@
|
|||||||
http://github.com/piroor/fxaddonlibs/blob/master/tabsDragUtils.js
|
http://github.com/piroor/fxaddonlibs/blob/master/tabsDragUtils.js
|
||||||
*/
|
*/
|
||||||
(function() {
|
(function() {
|
||||||
const currentRevision = 24;
|
const currentRevision = 25;
|
||||||
|
|
||||||
if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
|
if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
|
||||||
|
|
||||||
@ -191,6 +191,10 @@
|
|||||||
'if (newIndex >= oldIndex)',
|
'if (newIndex >= oldIndex)',
|
||||||
'if (TDUContext.utils.checkDontMove(TDUContext)) return;\n' +
|
'if (TDUContext.utils.checkDontMove(TDUContext)) return;\n' +
|
||||||
'$&'
|
'$&'
|
||||||
|
).replace(
|
||||||
|
'draggedTab._dragData.animDropIndex = newIndex;',
|
||||||
|
'TDUContext.utils.updateDropIndex(newIndex, TDUContext);\n' +
|
||||||
|
'$&'
|
||||||
).replace(
|
).replace(
|
||||||
'-tabWidth : tabWidth',
|
'-tabWidth : tabWidth',
|
||||||
'/* $& */ -TDUContext.tabsSize : TDUContext.tabsSize'
|
'/* $& */ -TDUContext.tabsSize : TDUContext.tabsSize'
|
||||||
@ -308,6 +312,7 @@
|
|||||||
// newIndex++;
|
// newIndex++;
|
||||||
// if (newIndex < 0 || newIndex == oldIndex)
|
// if (newIndex < 0 || newIndex == oldIndex)
|
||||||
// return;
|
// return;
|
||||||
|
// TDUContext.utils.updateDropIndex(newIndex, TDUContext);
|
||||||
// draggedTab._dragData.animDropIndex = newIndex;
|
// draggedTab._dragData.animDropIndex = newIndex;
|
||||||
//
|
//
|
||||||
// // Shift background tabs to leave a gap where the dragged tab
|
// // Shift background tabs to leave a gap where the dragged tab
|
||||||
@ -339,7 +344,9 @@
|
|||||||
var context = {};
|
var context = {};
|
||||||
|
|
||||||
context.draggedTabs = this.getDraggedTabs(aEvent);
|
context.draggedTabs = this.getDraggedTabs(aEvent);
|
||||||
context.draggedTab = context.draggedTabs[0];
|
// var originalDraggedTab = aEvent.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0);
|
||||||
|
var firstDraggedTab = context.draggedTabs[0];
|
||||||
|
context.draggedTab = /* originalDraggedTab ||*/ firstDraggedTab;
|
||||||
|
|
||||||
if (typeof aOptions == 'boolean') aOptions = { canDropOnSelf: aOptions };
|
if (typeof aOptions == 'boolean') aOptions = { canDropOnSelf: aOptions };
|
||||||
context.options = aOptions || {};
|
context.options = aOptions || {};
|
||||||
@ -402,9 +409,9 @@
|
|||||||
|
|
||||||
if (!('animLastScreenX' in draggedTab._dragData))
|
if (!('animLastScreenX' in draggedTab._dragData))
|
||||||
draggedTab._dragData.animLastScreenX = draggedTab._dragData[context.position];
|
draggedTab._dragData.animLastScreenX = draggedTab._dragData[context.position];
|
||||||
|
if (!('previousPosition' in draggedTab._dragData))
|
||||||
|
draggedTab._dragData.previousPosition = context.currentPositionCoordinate;
|
||||||
}, this);
|
}, this);
|
||||||
if (!('previousPosition' in context.draggedTab._dragData))
|
|
||||||
context.draggedTab._dragData.previousPosition = context.currentPositionCoordinate;
|
|
||||||
},
|
},
|
||||||
fixDragData : function TDU_fixDragData(aData)
|
fixDragData : function TDU_fixDragData(aData)
|
||||||
{
|
{
|
||||||
@ -498,7 +505,9 @@
|
|||||||
},
|
},
|
||||||
checkDontMove : function TDU_checkDontMove(context)
|
checkDontMove : function TDU_checkDontMove(context)
|
||||||
{
|
{
|
||||||
context.draggedTab._dragData.previousPosition = context.currentPositionCoordinate;
|
context.draggedTabs.forEach(function(draggedTab) {
|
||||||
|
draggedTab._dragData.previousPosition = context.currentPositionCoordinate;
|
||||||
|
});
|
||||||
return context.dontMove;
|
return context.dontMove;
|
||||||
},
|
},
|
||||||
extractNotDraggedTabs : function TDU_extractNotDraggedTabs(tabs, context)
|
extractNotDraggedTabs : function TDU_extractNotDraggedTabs(tabs, context)
|
||||||
@ -507,6 +516,12 @@
|
|||||||
return context.draggedTabs.indexOf(tab) < 0
|
return context.draggedTabs.indexOf(tab) < 0
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
updateDropIndex : function TDU_updateDropIndex(newIndex, context)
|
||||||
|
{
|
||||||
|
context.draggedTabs.forEach(function(draggedTab) {
|
||||||
|
draggedTab._dragData.animDropIndex = newIndex;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
destroyTabDNDObserver : function TDU_destroyTabDNDObserver(aObserver)
|
destroyTabDNDObserver : function TDU_destroyTabDNDObserver(aObserver)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user