kopia lustrzana https://github.com/c9/core
commit
235960748e
|
@ -567,10 +567,6 @@ var VirtualRenderer = function(container, cellWidth, cellHeight) {
|
||||||
var vertical = this.$treeLayer;
|
var vertical = this.$treeLayer;
|
||||||
var horizontal = this.$horHeadingLayer;
|
var horizontal = this.$horHeadingLayer;
|
||||||
|
|
||||||
var top = Math.max(this.scrollTop, 0);
|
|
||||||
var vRange = provider.getRange(top, top + this.$size.height);
|
|
||||||
var hRange = {size: 0}// horizontal.getRange(this.scrollLeft, this.scrollLeft + this.$size.width);
|
|
||||||
|
|
||||||
var minHeight = this.$size.scrollerHeight;
|
var minHeight = this.$size.scrollerHeight;
|
||||||
var maxHeight = provider.getTotalHeight();
|
var maxHeight = provider.getTotalHeight();
|
||||||
|
|
||||||
|
@ -605,6 +601,11 @@ var VirtualRenderer = function(container, cellWidth, cellHeight) {
|
||||||
if (this.provider.getScrollTop() != this.scrollTop)
|
if (this.provider.getScrollTop() != this.scrollTop)
|
||||||
this.scrollTop = this.provider.getScrollTop();
|
this.scrollTop = this.provider.getScrollTop();
|
||||||
|
|
||||||
|
var top = Math.max(this.scrollTop, 0);
|
||||||
|
var vRange = provider.getRange(top, top + this.$size.height);
|
||||||
|
var hRange = { size: 0 };// horizontal.getRange(this.scrollLeft, this.scrollLeft + this.$size.width);
|
||||||
|
|
||||||
|
|
||||||
var vOffset = this.scrollTop - vRange.size;
|
var vOffset = this.scrollTop - vRange.size;
|
||||||
var hOffset = this.scrollLeft - hRange.size;
|
var hOffset = this.scrollLeft - hRange.size;
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
|
@ -133,15 +133,20 @@ define(function(require, module, exports) {
|
||||||
emit("resize");
|
emit("resize");
|
||||||
});
|
});
|
||||||
var escHandler = function(e) {
|
var escHandler = function(e) {
|
||||||
|
if (dialog.visible) {
|
||||||
dialog.dispatchEvent("keydown", e);
|
dialog.dispatchEvent("keydown", e);
|
||||||
|
if (e.keyCode == 27) e.stopPropagation();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
var addEscHandler = function() {
|
||||||
document.body.addEventListener("keydown", escHandler, true);
|
document.body.addEventListener("keydown", escHandler, true);
|
||||||
plugin.on("hide", function() {
|
};
|
||||||
document.removeEventListener("keydown", escHandler, true);
|
var removeEscHandler = function() {
|
||||||
});
|
document.body.removeEventListener("keydown", escHandler, true);
|
||||||
plugin.on("unload", function() {
|
};
|
||||||
document.removeEventListener("keydown", escHandler, true);
|
plugin.on("show", addEscHandler);
|
||||||
});
|
plugin.on("hide", removeEscHandler);
|
||||||
|
plugin.on("unload", removeEscHandler);
|
||||||
|
|
||||||
titles = plugin.getElement("titles");
|
titles = plugin.getElement("titles");
|
||||||
buttons = plugin.getElement("buttons");
|
buttons = plugin.getElement("buttons");
|
||||||
|
|
|
@ -483,10 +483,9 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
layout.on("eachTheme", function(e) {
|
layout.on("eachTheme", function(e) {
|
||||||
var height = parseInt(ui.getStyleRule(".blackdg .row", "height"), 10) || 24;
|
var height = parseInt(ui.getStyleRule(".blackdg .row", "height"), 10) || 24;
|
||||||
model.rowHeightInner = height - 1;
|
|
||||||
model.rowHeight = height;
|
model.rowHeight = height;
|
||||||
|
|
||||||
if (e.changed) (datagrid).resize(true);
|
if (e.changed) datagrid.resize(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
model.$sorted = false;
|
model.$sorted = false;
|
||||||
|
@ -510,7 +509,6 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
datagrid = new Tree(div);
|
datagrid = new Tree(div);
|
||||||
datagrid.renderer.setTheme({ cssClass: "blackdg" });
|
datagrid.renderer.setTheme({ cssClass: "blackdg" });
|
||||||
datagrid.setOption("maxLines", 200);
|
|
||||||
datagrid.setDataProvider(model);
|
datagrid.setDataProvider(model);
|
||||||
datagrid.edit = new TreeEditor(datagrid);
|
datagrid.edit = new TreeEditor(datagrid);
|
||||||
|
|
||||||
|
@ -818,14 +816,18 @@ define(function(require, exports, module) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drawEnv();
|
drawEnv();
|
||||||
datagrid.resize();
|
|
||||||
|
|
||||||
model.session = currentSession;
|
model.session = currentSession;
|
||||||
if (!model.session.config.env)
|
if (!model.session.config.env)
|
||||||
model.session.config.env = {};
|
model.session.config.env = {};
|
||||||
|
|
||||||
reloadModel();
|
reloadModel();
|
||||||
|
|
||||||
|
var rect = mnuEnv.opener.$ext.getBoundingClientRect();
|
||||||
|
var top = rect.top;
|
||||||
|
var bottom = window.innerHeight - rect.bottom;
|
||||||
|
|
||||||
|
var maxRows = Math.floor(Math.max(top, bottom) / datagrid.model.rowHeight) - 2;
|
||||||
|
datagrid.setOption("maxLines", maxRows);
|
||||||
|
datagrid.resize();
|
||||||
mnuEnv.resize();
|
mnuEnv.resize();
|
||||||
|
|
||||||
var node = datagrid.getFirstNode();
|
var node = datagrid.getFirstNode();
|
||||||
|
|
|
@ -94,7 +94,6 @@
|
||||||
}
|
}
|
||||||
.envcontainer .blackdg{
|
.envcontainer .blackdg{
|
||||||
border-top: 1px solid #363636;
|
border-top: 1px solid #363636;
|
||||||
max-height : 300px;
|
|
||||||
}
|
}
|
||||||
.tree-row.newenv:not(.selected) {
|
.tree-row.newenv:not(.selected) {
|
||||||
color: rgb(151, 151, 151);
|
color: rgb(151, 151, 151);
|
||||||
|
|
Ładowanie…
Reference in New Issue