Merge pull request +15266 from c9/ide-papercuts

Ide papercuts
pull/402/head
Harutyun Amirjanyan 2017-02-13 23:02:19 +04:00 zatwierdzone przez GitHub
commit 235960748e
5 zmienionych plików z 52 dodań i 46 usunięć

Wyświetl plik

@ -567,10 +567,6 @@ var VirtualRenderer = function(container, cellWidth, cellHeight) {
var vertical = this.$treeLayer;
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 maxHeight = provider.getTotalHeight();
@ -604,6 +600,11 @@ var VirtualRenderer = function(container, cellWidth, cellHeight) {
if (this.provider.getScrollTop() != this.scrollTop)
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 hOffset = this.scrollLeft - hRange.size;

Wyświetl plik

@ -42,17 +42,12 @@ define(function(require, module, exports) {
group: "Panels",
bindKey: { mac: "Ctrl-Esc", win: "F6" },
exec: function(editor, args) {
var el;
if (hidden || args.show) {
show();
el = container;
focusConsole();
} else {
hide();
el = tabs.container;
}
var pane = tabs.findPane(container.$activePaneName);
var tab = pane && pane.activeTab || tabs.getTabs(el)[0];
tabs.focusTab(tab);
}
}, plugin);
@ -294,12 +289,21 @@ define(function(require, module, exports) {
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);
focusActiveTabInContainer(container);
}
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); }
@ -319,8 +323,15 @@ define(function(require, module, exports) {
pane._visible = !shouldHide;
});
if (!shouldHide && !tabs.focussedTab)
focusConsole();
if (!shouldHide) {
if (!tabs.focussedTab)
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() {
if (onFinishTimer)
@ -329,18 +340,6 @@ define(function(require, module, exports) {
onFinishTimer = setTimeout(function() {
if (shouldHide) {
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 {
container.$ext.style.minHeight = minHeight + "px";

Wyświetl plik

@ -133,15 +133,20 @@ define(function(require, module, exports) {
emit("resize");
});
var escHandler = function(e) {
dialog.dispatchEvent("keydown", e);
if (dialog.visible) {
dialog.dispatchEvent("keydown", e);
if (e.keyCode == 27) e.stopPropagation();
}
};
document.body.addEventListener("keydown", escHandler, true);
plugin.on("hide", function() {
document.removeEventListener("keydown", escHandler, true);
});
plugin.on("unload", function() {
document.removeEventListener("keydown", escHandler, true);
});
var addEscHandler = function() {
document.body.addEventListener("keydown", escHandler, true);
};
var removeEscHandler = function() {
document.body.removeEventListener("keydown", escHandler, true);
};
plugin.on("show", addEscHandler);
plugin.on("hide", removeEscHandler);
plugin.on("unload", removeEscHandler);
titles = plugin.getElement("titles");
buttons = plugin.getElement("buttons");

Wyświetl plik

@ -483,10 +483,9 @@ define(function(require, exports, module) {
layout.on("eachTheme", function(e) {
var height = parseInt(ui.getStyleRule(".blackdg .row", "height"), 10) || 24;
model.rowHeightInner = height - 1;
model.rowHeight = height;
if (e.changed) (datagrid).resize(true);
if (e.changed) datagrid.resize(true);
});
model.$sorted = false;
@ -510,7 +509,6 @@ define(function(require, exports, module) {
datagrid = new Tree(div);
datagrid.renderer.setTheme({ cssClass: "blackdg" });
datagrid.setOption("maxLines", 200);
datagrid.setDataProvider(model);
datagrid.edit = new TreeEditor(datagrid);
@ -818,14 +816,18 @@ define(function(require, exports, module) {
return;
drawEnv();
datagrid.resize();
model.session = currentSession;
if (!model.session.config.env)
model.session.config.env = {};
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();
var node = datagrid.getFirstNode();

Wyświetl plik

@ -94,7 +94,6 @@
}
.envcontainer .blackdg{
border-top: 1px solid #363636;
max-height : 300px;
}
.tree-row.newenv:not(.selected) {
color: rgb(151, 151, 151);