タブを閉じた後などにキーボードショートカット等が聞かなくなる問題について暫定対処2
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5593 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
8a67144922
commit
b705a90131
@ -27,6 +27,7 @@
|
|||||||
revision : currentRevision,
|
revision : currentRevision,
|
||||||
|
|
||||||
_stopLevel : 0,
|
_stopLevel : 0,
|
||||||
|
_lastFocusedWindow : null,
|
||||||
|
|
||||||
get rootContentViewer()
|
get rootContentViewer()
|
||||||
{
|
{
|
||||||
@ -38,14 +39,10 @@
|
|||||||
.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
|
.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
|
||||||
},
|
},
|
||||||
|
|
||||||
get isActive()
|
|
||||||
{
|
|
||||||
return window.top.document.documentElement.getAttribute('active') == 'true';
|
|
||||||
},
|
|
||||||
|
|
||||||
stop : function()
|
stop : function()
|
||||||
{
|
{
|
||||||
if (!this._stopLevel) {
|
if (!this._stopLevel) {
|
||||||
|
this._lastFocusedWindow = window.top.document.commandDispatcher.focusedWindow;
|
||||||
this.rootContentViewer.hide();
|
this.rootContentViewer.hide();
|
||||||
}
|
}
|
||||||
this._stopLevel++;
|
this._stopLevel++;
|
||||||
@ -56,13 +53,10 @@
|
|||||||
this._stopLevel--;
|
this._stopLevel--;
|
||||||
if (!this._stopLevel) {
|
if (!this._stopLevel) {
|
||||||
this.rootContentViewer.show();
|
this.rootContentViewer.show();
|
||||||
if (this.isActive && !this.timer) {
|
if (this._lastFocusedWindow) {
|
||||||
this.timer = window.setTimeout(function(aSelf) {
|
window.top.document.commandDispatcher.focusedWindow = this._lastFocusedWindow;
|
||||||
aSelf.timer = null;
|
|
||||||
window.top.blur();
|
|
||||||
window.top.focus();
|
|
||||||
}, 0, this);
|
|
||||||
}
|
}
|
||||||
|
this._lastFocusedWindow = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user