diff --git a/content/treestyletab/hide-embed.css b/content/treestyletab/hide-embed.css new file mode 100644 index 00000000..13cb6c2a --- /dev/null +++ b/content/treestyletab/hide-embed.css @@ -0,0 +1,5 @@ +@namespace url("http://www.w3.org/1999/xhtml"); + +body > embed[name="plugin"] { + visibility: hidden !important; +} diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 17c53b08..ab4b8dd2 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1531,6 +1531,7 @@ var TreeStyleTabService = { // no feedback image, because it's annoying... dt.setDragImage(new Image(), 0, 0); aEvent.stopPropagation(); + this.treeStyleTab.tabbarDNDObserver.readyToStartDrag(); } else $&]]> ) diff --git a/content/treestyletab/treestyletabbrowser_tabbarDNDObserver.js b/content/treestyletab/treestyletabbrowser_tabbarDNDObserver.js index 970f7294..1295f91a 100644 --- a/content/treestyletab/treestyletabbrowser_tabbarDNDObserver.js +++ b/content/treestyletab/treestyletabbrowser_tabbarDNDObserver.js @@ -21,6 +21,8 @@ TreeStyleTabBrowserTabbarDNDObserver.prototype = { sv.kTABBAR_MOVE_NORMAL ); + this.readyToStartDrag(); + aEvent.stopPropagation(); return true; }, @@ -77,6 +79,32 @@ TreeStyleTabBrowserTabbarDNDObserver.prototype = { return canDrag; }, + get SSS() + { + if (this._SSS === void(0)) { + if ('@mozilla.org/content/style-sheet-service;1' in Components.classes) { + this._SSS = Components.classes['@mozilla.org/content/style-sheet-service;1'].getService(Components.interfaces.nsIStyleSheetService); + } + if (!this._SSS) + this._SSS = null; + } + return this._SSS; + }, + + readyToStartDrag : function() + { + var sheet = this.mOwner.makeURIFromSpec('chrome://treestyletab/content/hide-embed.css'); + if (!this.SSS.sheetRegistered(sheet, this.SSS.AGENT_SHEET)) + this.SSS.loadAndRegisterSheet(sheet, this.SSS.AGENT_SHEET); + }, + + readyToEndDrag : function() + { + var sheet = this.mOwner.makeURIFromSpec('chrome://treestyletab/content/hide-embed.css'); + if (this.SSS.sheetRegistered(sheet, this.SSS.AGENT_SHEET)) + this.SSS.unregisterSheet(sheet, this.SSS.AGENT_SHEET); + }, + onDragEnter : function(aEvent, aDragSession) { var sv = this.mOwner; @@ -123,10 +151,10 @@ TreeStyleTabBrowserTabbarDNDObserver.prototype = { onDragEnd : function(aEvent) { - var sv = this.mOwner; - window.setTimeout(function() { - sv.mTabBrowser.removeAttribute(sv.kDROP_POSITION); - }, 10); + window.setTimeout(function(aSelf) { + aSelf.readyToEndDrag(); + aSelf.mOwner.mTabBrowser.removeAttribute(aSelf.mOwner.kDROP_POSITION); + }, 10, this); aEvent.stopPropagation(); },