From 086390593e7a79d8c46a86b0ed8bb0a2fb50e72b Mon Sep 17 00:00:00 2001 From: zhizous Date: Thu, 7 Nov 2019 22:21:34 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=20=E8=A7=A3=E5=86=B3=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 1 + js/okadmin.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index b395034..2b99120 100644 --- a/index.html +++ b/index.html @@ -52,6 +52,7 @@ +
  • diff --git a/js/okadmin.js b/js/okadmin.js index feb7c6a..9903492 100644 --- a/js/okadmin.js +++ b/js/okadmin.js @@ -148,29 +148,34 @@ layui.use(["element", "layer", "okUtils", "okTab", "okLayer", "okContextMenu"], }); /** - * 全屏/退出全屏 + * 键盘的事件监听 */ $("body").on("keydown", function (event) { event = event || window.event || arguments.callee.caller.arguments[0]; + // 按 Esc if (event && event.keyCode === 27) { console.log("Esc"); - $("#fullScreen").children("i").eq(0).removeClass("okicon-screen-restore"); + $("#fullScreen").children("i").eq(0).removeClass("layui-icon-screen-restore"); } // 按 F11 if (event && event.keyCode == 122) { - $("#fullScreen").children("i").eq(0).addClass("okicon-screen-restore"); + console.log("F11"); + $("#fullScreen").children("i").eq(0).addClass("layui-icon-screen-restore"); } }); + /** + * 全屏/退出全屏 + */ $("body").on("click", "#fullScreen", function () { - if ($(this).children("i").hasClass("okicon-screen-restore")) { + if ($(this).children("i").hasClass("layui-icon-screen-restore")) { screenFun(2).then(function () { - $(this).children("i").eq(0).removeClass("okicon-screen-restore"); + $("#fullScreen").children("i").eq(0).removeClass("layui-icon-screen-restore"); }); } else { screenFun(1).then(function () { - $(this).children("i").eq(0).addClass("okicon-screen-restore"); + $("#fullScreen").children("i").eq(0).addClass("layui-icon-screen-restore"); }); } });