PDFを開いたタブが選択されている時にドラッグ&ドロップでタブバーを移動できない問題にアドホックな対処

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5486 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-11-23 18:04:40 +00:00
parent cf098371a1
commit 9d48654b02
3 changed files with 38 additions and 4 deletions

View File

@ -0,0 +1,5 @@
@namespace url("http://www.w3.org/1999/xhtml");
body > embed[name="plugin"] {
visibility: hidden !important;
}

View File

@ -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 $&]]>
)

View File

@ -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();
},