kopia lustrzana https://github.com/c9/core
fix console focus issue
rodzic
7a13852332
commit
e8da10c048
|
@ -42,17 +42,12 @@ define(function(require, module, exports) {
|
||||||
group: "Panels",
|
group: "Panels",
|
||||||
bindKey: { mac: "Ctrl-Esc", win: "F6" },
|
bindKey: { mac: "Ctrl-Esc", win: "F6" },
|
||||||
exec: function(editor, args) {
|
exec: function(editor, args) {
|
||||||
var el;
|
|
||||||
if (hidden || args.show) {
|
if (hidden || args.show) {
|
||||||
show();
|
show();
|
||||||
el = container;
|
focusConsole();
|
||||||
} else {
|
} else {
|
||||||
hide();
|
hide();
|
||||||
el = tabs.container;
|
|
||||||
}
|
}
|
||||||
var pane = tabs.findPane(container.$activePaneName);
|
|
||||||
var tab = pane && pane.activeTab || tabs.getTabs(el)[0];
|
|
||||||
tabs.focusTab(tab);
|
|
||||||
}
|
}
|
||||||
}, plugin);
|
}, plugin);
|
||||||
|
|
||||||
|
@ -294,12 +289,21 @@ define(function(require, module, exports) {
|
||||||
var oldFocus = tabs.focussedTab;
|
var oldFocus = tabs.focussedTab;
|
||||||
if (oldFocus && getPanes().indexOf(oldFocus.pane) != -1)
|
if (oldFocus && getPanes().indexOf(oldFocus.pane) != -1)
|
||||||
return tabs.focusTab(oldFocus);
|
return tabs.focusTab(oldFocus);
|
||||||
getPanes().some(function(pane) {
|
|
||||||
if (pane.getTab()) {
|
focusActiveTabInContainer(container);
|
||||||
tabs.focusTab(pane.getTab());
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}) || tabs.focusTab(null);
|
|
||||||
|
function focusActiveTabInContainer(containerEl) {
|
||||||
|
var pane = tabs.findPane(containerEl.$activePaneName);
|
||||||
|
var tab = pane && pane.activeTab;
|
||||||
|
if (!tab) {
|
||||||
|
tabs.getPanes(containerEl).every(function(pane) {
|
||||||
|
tab = pane.activeTab;
|
||||||
|
return !tab;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
tabs.focusTab(tab);
|
||||||
|
return tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide(immediate) { show(immediate, true); }
|
function hide(immediate) { show(immediate, true); }
|
||||||
|
@ -319,8 +323,15 @@ define(function(require, module, exports) {
|
||||||
pane._visible = !shouldHide;
|
pane._visible = !shouldHide;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!shouldHide && !tabs.focussedTab)
|
if (!shouldHide) {
|
||||||
|
if (!tabs.focussedTab)
|
||||||
focusConsole();
|
focusConsole();
|
||||||
|
}
|
||||||
|
else if (tabs.focussedTab && getPanes().indexOf(tabs.focussedTab.pane) > -1) {
|
||||||
|
// If the focussed tab is in the console, make the first
|
||||||
|
// tab we can find inside the tabs the focussed tab.
|
||||||
|
focusActiveTabInContainer(tabs.container);
|
||||||
|
}
|
||||||
|
|
||||||
var finish = function() {
|
var finish = function() {
|
||||||
if (onFinishTimer)
|
if (onFinishTimer)
|
||||||
|
@ -329,18 +340,6 @@ define(function(require, module, exports) {
|
||||||
onFinishTimer = setTimeout(function() {
|
onFinishTimer = setTimeout(function() {
|
||||||
if (shouldHide) {
|
if (shouldHide) {
|
||||||
container.hide();
|
container.hide();
|
||||||
|
|
||||||
// If the focussed tab is in the console, make the first
|
|
||||||
// tab we can find inside the tabs the focussed tab.
|
|
||||||
if (tabs.focussedTab
|
|
||||||
&& getPanes().indexOf(tabs.focussedTab.pane) > -1) {
|
|
||||||
var tab;
|
|
||||||
tabs.getPanes(tabs.container).every(function(pane) {
|
|
||||||
tab = pane.activeTab;
|
|
||||||
return !tab;
|
|
||||||
});
|
|
||||||
tabs.focusTab(tab);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
container.$ext.style.minHeight = minHeight + "px";
|
container.$ext.style.minHeight = minHeight + "px";
|
||||||
|
|
Ładowanie…
Reference in New Issue