Bug 674732 - Re-support tab duplication/bookmarking via ctrl/opt+drag. r=dao
authorFrank Yan <fyan@mozilla.com>
Thu, 28 Jul 2011 21:26:38 -0700
changeset 73504 5fc7b3f0bae67ba77280328388d55a58bf96370c
parent 73503 5bd0acd3230871f83f199c555ee050d854ea9f32
child 73505 cef1817c3b13bcb5065b721a35dee94a2940e339
push idunknown
push userunknown
push dateunknown
reviewersdao
bugs674732
milestone8.0a1
Bug 674732 - Re-support tab duplication/bookmarking via ctrl/opt+drag. r=dao
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3808,16 +3808,31 @@
 
       <handler event="dragstart"><![CDATA[
         if (this.draggedTab)
           return;
         var tab = this._getDragTargetTab(event);
         if (!tab || !tab._fullyOpen || tab.closing)
           return;
 
+#ifdef XP_MACOSX
+        if (event.altKey) {
+#else
+        if (event.ctrlKey) {
+#endif
+          let dt = event.dataTransfer;
+          let uri = this.tabbrowser.getBrowserForTab(tab).currentURI;
+          let spec = uri ? uri.spec : "about:blank";
+          dt.setData("text/x-moz-url", spec);
+
+          let favicon = document.getAnonymousElementByAttribute(tab, "class", "tab-icon-image");
+          dt.setDragImage(favicon, 16, 16);
+          return;
+        }
+
         this.setAttribute("drag", "move");
         this.draggedTab = tab;
         tab.setAttribute("dragged", "true");
         let data = tab._dragData = {};
         data._dragStartX = event.screenX;
         if (!tab.pinned)
           data._dragStartX += this.mTabstrip.scrollPosition;
         data._dragDistX = 0;