Bug 815961 - After dragging & dropping a tab the tabstrip scrolls to center the tab. r=felipe
authorDão Gottwald <dao@mozilla.com>
Thu, 06 Dec 2012 11:42:07 +0100
changeset 120766 bfb0857b27516052ff175fdf86dbf6cbdcb86aac
parent 120765 cd845cbfc76ea496ca593ca1d3cc9d6ce8528ddb
child 120767 4e267b18260baf966d89ae6965b10854e8366185
push idunknown
push userunknown
push dateunknown
reviewersfelipe
bugs815961
milestone20.0a1
Bug 815961 - After dragging & dropping a tab the tabstrip scrolls to center the tab. r=felipe
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3751,24 +3751,25 @@
         if (draggedTab && dropEffect == "copy") {
           // copy the dropped tab (wherever it's from)
           let newIndex = this._getDropIndex(event);
           let newTab = this.tabbrowser.duplicateTab(draggedTab);
           this.tabbrowser.moveTabTo(newTab, newIndex);
           if (draggedTab.parentNode != this || event.shiftKey)
             this.selectedItem = newTab;
         } else if (draggedTab && draggedTab.parentNode == this) {
+          this._finishAnimateTabMove();
+
           // actually move the dragged tab
           if ("animDropIndex" in draggedTab._dragData) {
             let newIndex = draggedTab._dragData.animDropIndex;
             if (newIndex > draggedTab._tPos)
               newIndex--;
             this.tabbrowser.moveTabTo(draggedTab, newIndex);
           }
-          this._finishAnimateTabMove();
         } else if (draggedTab) {
           // swap the dropped tab with a new one we create and then close
           // it in the other window (making it seem to have moved between
           // windows)
           let newIndex = this._getDropIndex(event);
           let newTab = this.tabbrowser.addTab("about:blank");
           let newBrowser = this.tabbrowser.getBrowserForTab(newTab);
           // Stop the about:blank load