Allow to move pinned tabs by dragging correctly (#585)

This commit is contained in:
Piro / YUKI Hiroshi 2013-11-28 04:42:44 +09:00
parent 1198defd82
commit e7afa3b86d

View File

@ -481,12 +481,16 @@ catch(e) {
performDrop : function TabbarDND_performDrop(aInfo, aDraggedTab) performDrop : function TabbarDND_performDrop(aInfo, aDraggedTab)
{ {
if (DEBUG) dump('performDrop: start\n');
var sv = this.treeStyleTab; var sv = this.treeStyleTab;
var b = this.browser; var b = this.browser;
var w = this.window; var w = this.window;
var tabsInfo = this.getDraggedTabsInfoFromOneTab(aDraggedTab, aInfo); var tabsInfo = this.getDraggedTabsInfoFromOneTab(aDraggedTab, aInfo);
if (!tabsInfo.draggedTab) return false; if (!tabsInfo.draggedTab) {
if (DEBUG) dump(' => no dragged tab\n');
return false;
}
var sourceWindow = aDraggedTab.ownerDocument.defaultView; var sourceWindow = aDraggedTab.ownerDocument.defaultView;
var sourceBrowser = sourceWindow.TreeStyleTabService.getTabBrowserFromChild(aDraggedTab); var sourceBrowser = sourceWindow.TreeStyleTabService.getTabBrowserFromChild(aDraggedTab);
@ -535,14 +539,13 @@ catch(e) {
else if (aInfo.action & sv.kACTION_ATTACH) { else if (aInfo.action & sv.kACTION_ATTACH) {
this.attachTabsOnDrop(draggedRoots, aInfo.parent); this.attachTabsOnDrop(draggedRoots, aInfo.parent);
} }
else { // otherwise, just moved.
return false;
}
if ( // if this move will cause no change... if ( // if this move will cause no change...
sourceBrowser == targetBrowser && sourceBrowser == targetBrowser &&
sourceService.getNextVisibleTab(draggedTabs[draggedTabs.length-1]) == aInfo.insertBefore sourceService.getNextVisibleTab(draggedTabs[draggedTabs.length-1]) == aInfo.insertBefore
) { ) {
if (DEBUG) dump(' => no change\n');
// then, do nothing // then, do nothing
return true; return true;
} }