From e7afa3b86d94fdc8953e43042c6f85773246c9b5 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Thu, 28 Nov 2013 04:42:44 +0900 Subject: [PATCH] Allow to move pinned tabs by dragging correctly (#585) --- modules/tabbarDNDObserver.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js index 2383569c..40087052 100644 --- a/modules/tabbarDNDObserver.js +++ b/modules/tabbarDNDObserver.js @@ -481,12 +481,16 @@ catch(e) { performDrop : function TabbarDND_performDrop(aInfo, aDraggedTab) { + if (DEBUG) dump('performDrop: start\n'); var sv = this.treeStyleTab; var b = this.browser; var w = this.window; 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 sourceBrowser = sourceWindow.TreeStyleTabService.getTabBrowserFromChild(aDraggedTab); @@ -535,14 +539,13 @@ catch(e) { else if (aInfo.action & sv.kACTION_ATTACH) { this.attachTabsOnDrop(draggedRoots, aInfo.parent); } - else { - return false; - } + // otherwise, just moved. if ( // if this move will cause no change... sourceBrowser == targetBrowser && sourceService.getNextVisibleTab(draggedTabs[draggedTabs.length-1]) == aInfo.insertBefore ) { + if (DEBUG) dump(' => no change\n'); // then, do nothing return true; }