From 9d48654b0252bf3f0f7ce37ed72b413717870e13 Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 23 Nov 2009 18:04:40 +0000 Subject: [PATCH] =?UTF-8?q?PDF=E3=82=92=E9=96=8B=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=82=BF=E3=83=96=E3=81=8C=E9=81=B8=E6=8A=9E=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E6=99=82=E3=81=AB=E3=83=89=E3=83=A9?= =?UTF-8?q?=E3=83=83=E3=82=B0&=E3=83=89=E3=83=AD=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=81=A7=E3=82=BF=E3=83=96=E3=83=90=E3=83=BC=E3=82=92=E7=A7=BB?= =?UTF-8?q?=E5=8B=95=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=81=AB=E3=82=A2=E3=83=89=E3=83=9B=E3=83=83=E3=82=AF=E3=81=AA?= =?UTF-8?q?=E5=AF=BE=E5=87=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5486 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/hide-embed.css | 5 +++ content/treestyletab/treestyletab.js | 1 + .../treestyletabbrowser_tabbarDNDObserver.js | 36 ++++++++++++++++--- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 content/treestyletab/hide-embed.css 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(); },