快捷键关闭当前编辑器 bug 修复 & 关闭编辑器后焦点设置
This commit is contained in:
parent
c9443a8851
commit
78accaa82e
|
@ -45,6 +45,9 @@ var editors = {
|
|||
$("#dialogCloseEditor").data("removeData", removeData);
|
||||
$(".edit-panel .tabs > div[data-index=" + removeIndex + "] .ico-close").click();
|
||||
}
|
||||
if (wide.curEditor) {
|
||||
wide.curEditor.focus();
|
||||
}
|
||||
},
|
||||
_initClose: function () {
|
||||
new ZeroClipboard($("#copyFilePath"));
|
||||
|
@ -90,7 +93,6 @@ var editors = {
|
|||
wide.fmt(tree.fileTree.getNodeByTId(editors.data[i].id).path, editors.data[i].editor);
|
||||
editors.tabs.del(editors.data[i].id);
|
||||
$("#dialogCloseEditor").dialog("close");
|
||||
|
||||
editors._removeAllMarker();
|
||||
});
|
||||
|
||||
|
@ -98,13 +100,11 @@ var editors = {
|
|||
var i = $("#dialogCloseEditor").data("index");
|
||||
editors.tabs.del(editors.data[i].id);
|
||||
$("#dialogCloseEditor").dialog("close");
|
||||
|
||||
editors._removeAllMarker();
|
||||
});
|
||||
|
||||
$("#dialogCloseEditor button.cancel").click(function () {
|
||||
$("#dialogCloseEditor button.cancel").click(function (event) {
|
||||
$("#dialogCloseEditor").dialog("close");
|
||||
|
||||
editors._removeAllMarker();
|
||||
});
|
||||
}
|
||||
|
@ -112,6 +112,11 @@ var editors = {
|
|||
|
||||
editors.tabs = new Tabs({
|
||||
id: ".edit-panel",
|
||||
setAfter: function () {
|
||||
if (wide.curEditor) {
|
||||
wide.curEditor.focus();
|
||||
}
|
||||
},
|
||||
clickAfter: function (id) {
|
||||
if (id === 'startPage') {
|
||||
$(".footer .cursor").text('');
|
||||
|
|
|
@ -373,10 +373,7 @@ var hotkeys = {
|
|||
|
||||
if (event.ctrlKey === hotKeys.closeCurEditor.ctrlKey
|
||||
&& event.which === hotKeys.closeCurEditor.which) { // Ctrl+Q 关闭当前编辑器
|
||||
var currentId = editors.getCurrentId();
|
||||
if (currentId) {
|
||||
editors.tabs.del(currentId);
|
||||
}
|
||||
$(".edit-panel .tabs > div.current").find(".ico-close").click();
|
||||
event.preventDefault();
|
||||
|
||||
return;
|
||||
|
|
|
@ -139,5 +139,9 @@ $.extend(Tabs.prototype, {
|
|||
|
||||
$tabs.children("div[data-index='" + id + "']").addClass("current");
|
||||
$tabsPanel.children("div[data-index='" + id + "']").show();
|
||||
|
||||
if (typeof this.obj.setAfter === 'function') {
|
||||
this.obj.setAfter();
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue