bug fixed

This commit is contained in:
Van 2014-09-26 16:41:25 +08:00
parent 2c9097b5b8
commit 128e34795e
3 changed files with 45 additions and 33 deletions

View File

@ -282,7 +282,7 @@ var editors = {
}); });
editor.on('focus', function (cm) { editor.on('focus', function (cm) {
windows.clearSideBottom(); windows.clearFloat();
}); });
editor.setSize('100%', $(".edit-panel").height() - $(".edit-panel .tabs").height()); editor.setSize('100%', $(".edit-panel").height() - $(".edit-panel .tabs").height());

View File

@ -192,12 +192,16 @@ var hotkeys = {
if (event.ctrlKey === hotKeys.goFileTree.ctrlKey if (event.ctrlKey === hotKeys.goFileTree.ctrlKey
&& event.which === hotKeys.goFileTree.which) { // Ctrl+1 焦点切换到文件树 && event.which === hotKeys.goFileTree.which) { // Ctrl+1 焦点切换到文件树
// 有些元素需设置 tabindex 为 -1 时才可以 focus // 有些元素需设置 tabindex 为 -1 时才可以 focus
if (windows.isEditorMax()) { if ($(".footer .ico-restore:eq(0)").css("display") === "inline") {
// 编辑器全屏 // 当文件树最小化时
$(".bottom-window-group").css("top", "100%");
$(".side").css({ $(".side").css({
"left": "0" "left": "0"
}); });
if ($(".footer .ico-restore:eq(1)").css("display") === "inline") {
// 当底部最小化时
$(".bottom-window-group").css("top", "100%");
}
} }
$("#files").focus(); $("#files").focus();

View File

@ -54,10 +54,12 @@ var windows = {
$(window).click(function (event) { $(window).click(function (event) {
if ($(event.target).closest(".footer").length === 1 if ($(event.target).closest(".footer").length === 1
|| $(event.target).closest(".bottom-window-group").length === 1) { || $(event.target).closest(".bottom-window-group").length === 1
|| $(event.target).closest(".side").length === 1) {
return false; return false;
} }
windows.clearSideBottom();
windows.clearFloat();
}); });
}, },
maxBottom: function () { maxBottom: function () {
@ -65,11 +67,11 @@ var windows = {
if ($it.hasClass("bottom-window-group-max")) { if ($it.hasClass("bottom-window-group-max")) {
windows.restoreBottom(); windows.restoreBottom();
if ($(".side").css("left") !== "0px") { if ($(".side").css("left") !== "0px" && $(".side").css("left") !== "auto") {
$it.css({ $it.css({
"left": "0px", "left": "0px",
"width": "100%" "width": "100%"
}); });
} }
} else { } else {
$it.attr("style", ""); $it.attr("style", "");
@ -90,13 +92,14 @@ var windows = {
} }
}, },
restoreBottom: function () { restoreBottom: function () {
$(".bottom-window-group").removeClass("bottom-window-group-max"); var $it = $(".bottom-window-group");
var bottomH = $(".bottom-window-group").height(); $it.removeClass("bottom-window-group-max").attr("style", "");
var bottomH = $it.height();
$(".bottom-window-group .output, notification").height(bottomH - 24); $(".bottom-window-group .output, notification").height(bottomH - 24);
$(".bottom-window-group .notification, .bottom-window-group .search").height(bottomH - 20); $(".bottom-window-group .notification, .bottom-window-group .search").height(bottomH - 20);
$(".bottom-window-group").animate({ $it.animate({
"top": "70%" "top": "70%"
}, function () { }, function () {
$(".edit-panel").css("height", "70%"); $(".edit-panel").css("height", "70%");
@ -163,26 +166,31 @@ var windows = {
windows.restoreSide(); windows.restoreSide();
wide.curEditor.focus(); wide.curEditor.focus();
}, },
clearSideBottom: function () { clearFloat: function () {
if (!this.isEditorMax()) { if ($(".footer .ico-restore:eq(0)").css("display") === "inline") {
return false; // 当文件树最小化时
} windows.minSide();
$(".side").css("left", "-20%");
$(".bottom-window-group").css("top", "100%");
},
flowBottom: function () {
if (this.isEditorMax()) {
$(".bottom-window-group").animate({"top": "70%"});
$(".side").css("left", "-20%");
}
},
isEditorMax: function () {
if ($(".toolbars .ico-restore").length === 1
&& $(".footer .ico-restore:eq(0)").css("display") === "inline"
&& $(".footer .ico-restore:eq(1)").css("display") === "inline") {
return true;
} }
return false; if ($(".footer .ico-restore:eq(1)").css("display") === "inline") {
// 当底部最小化时
windows.minBottom();
}
},
flowBottom: function () {
if ($(".footer .ico-restore:eq(1)").css("display") === "inline") {
// 当底部树最小化时
$(".bottom-window-group").css({
"top": "70%",
"left": "0px",
"width": "100%",
"z-index": "8"
});
if ($(".footer .ico-restore:eq(0)").css("display") === "inline") {
// 当文件最小化时
$(".side").css("left", "-20%");
}
}
} }
}; };