mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
fix console focus issue
This commit is contained in:
parent
e38bb8cf19
commit
2b080175d7
@ -250,7 +250,9 @@ define(function(require, module, exports) {
|
||||
settings.set("state/console/@maximized", true);
|
||||
plugin.getElement("btnConsoleMax").setValue(true);
|
||||
|
||||
setTimeout(function(){
|
||||
focusConsole();
|
||||
|
||||
setTimeout(function() {
|
||||
getPanes().forEach(function(pane) {
|
||||
var tab = pane.activeTab;
|
||||
if (tab)
|
||||
@ -277,6 +279,8 @@ define(function(require, module, exports) {
|
||||
settings.set("state/console/@maximized", false);
|
||||
plugin.getElement("btnConsoleMax").setValue(false);
|
||||
|
||||
focusConsole();
|
||||
|
||||
getPanes().forEach(function(pane) {
|
||||
var tab = pane.activeTab;
|
||||
if (tab)
|
||||
@ -286,6 +290,18 @@ define(function(require, module, exports) {
|
||||
emit("resize");
|
||||
}
|
||||
|
||||
function focusConsole() {
|
||||
var oldFocus = tabs.focussedTab;
|
||||
if (oldFocus && getPanes().indexOf(oldFocus.pane) != -1)
|
||||
return tabs.focusTab(oldFocus);
|
||||
getPanes().some(function(pane) {
|
||||
if (pane.getTab()) {
|
||||
tabs.focusTab(pane.getTab());
|
||||
return true;
|
||||
}
|
||||
}) || tabs.focusTab(null);
|
||||
}
|
||||
|
||||
function hide(immediate) { show(immediate, true); }
|
||||
|
||||
function show(immediate, shouldHide) {
|
||||
@ -303,14 +319,8 @@ define(function(require, module, exports) {
|
||||
pane._visible = !shouldHide;
|
||||
});
|
||||
|
||||
if (!shouldHide && !tabs.focussedTab) {
|
||||
getPanes().some(function(pane) {
|
||||
if (pane.getTab()) {
|
||||
tabs.focusTab(pane.getTab());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!shouldHide && !tabs.focussedTab)
|
||||
focusConsole();
|
||||
|
||||
var finish = function() {
|
||||
if (onFinishTimer)
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
<a:application xmlns:a="http://ajax.org/2005/aml">
|
||||
<a:hbox id="consoleButtons" pack="end" top="0" right="3" height="24" align="center" padding="0" zindex="1000">
|
||||
<a:button id="btnConsoleMax" skin="btn_console" class="maximize" command="maximizeconsole" state="true" margin="2 2 0 0" />
|
||||
<a:button id="btnConsoleMax" skin="btn_console" class="maximize" command="maximizeconsole" state="true" margin="2 2 0 0" focussable="false" />
|
||||
<a:divider skin="divider_console" margin="3 0 0 3"></a:divider>
|
||||
<a:button
|
||||
id="btnClose"
|
||||
skin="btn_icon_only"
|
||||
class="dim22-22 console_close_btn btn_icon_onlyIcon"
|
||||
command="toggleconsole"
|
||||
focussable="false"
|
||||
margin="1 0 0 1" />
|
||||
</a:hbox>
|
||||
</a:application>
|
||||
@ -21558,7 +21558,7 @@ apf.window = function(){
|
||||
canSelect = false;
|
||||
}
|
||||
|
||||
if (amlNode && amlNode.name === "editor::ace" || amlNode.class == "c9terminalcontainer") {
|
||||
if (amlNode && (amlNode.name === "editor::ace" || amlNode.class == "c9terminalcontainer")) {
|
||||
canSelect = true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user