diff --git a/js/okconfig.js b/js/okconfig.js index 08b6765..08bd478 100644 --- a/js/okconfig.js +++ b/js/okconfig.js @@ -1,6 +1,6 @@ var okConfig = { theme: "blue_theme", //主题色orange_theme|blue_theme menuArrow: "ok-arrow2", //导航箭头ok-arrow2:箭头,不填为默认样式 - tabMemory: true, //是否开启tab刷新记忆 - tabRefresh: false, //是否开启切换刷新 + isTabMemory: true, //刷新后是否记住上次打开tab菜单 + isTabRefresh: false, //是否开启切换刷新 }; \ No newline at end of file diff --git a/lib/layui/lay/okmodules/okTab.js b/lib/layui/lay/okmodules/okTab.js index bf9faa5..a24400e 100644 --- a/lib/layui/lay/okmodules/okTab.js +++ b/lib/layui/lay/okmodules/okTab.js @@ -65,8 +65,8 @@ layui.define(["element", "jquery", "okUtils"], function (exports) { var element = layui.element, layer = layui.layer; config = okUtils.local("okConfig") || okConfig || {}; - console.log(config); - if(!config.tabMemory){ + + if(!config.isTabRefresh){ okUtils.session("tabMenu", null); okUtils.session("lay-id", null); } @@ -270,7 +270,7 @@ layui.define(["element", "jquery", "okUtils"], function (exports) { thatElem = $(elTabs[index]);//当前元素 saveTabMenuFun($); - if(config.tabRefresh){ /**切换刷新*/ + if(config.isTabRefresh){ /**切换刷新*/ $(".ok-tab-content .layui-show").find("iframe")[0].contentWindow.location.reload(true); } that.positionTab(elMove, thatElem); diff --git a/pages/system/setting.html b/pages/system/setting.html index d4783f3..94cdaf7 100644 --- a/pages/system/setting.html +++ b/pages/system/setting.html @@ -84,8 +84,8 @@ $(item).prop("checked", false); } }); - $("input[name=refresh]").prop("checked", config.tabRefresh); - $("input[name=memory]").prop("checked", config.tabMemory); + $("input[name=refresh]").prop("checked", config.isTabRefresh); + $("input[name=memory]").prop("checked", config.isTabMemory); form.render(); form.on('radio(arrow)', function (data) { //更改导航箭头样式 @@ -101,12 +101,12 @@ }); form.on('switch(refresh)', function (data) { //切换刷新 - config.tabRefresh = data.elem.checked; + config.isTabRefresh = data.elem.checked; okUtils.local("okConfig", config); }); form.on('switch(memory)', function (data) { //tab记忆 - config.tabMemory = data.elem.checked; + config.isTabRefresh = data.elem.checked; okUtils.local("okConfig", config); });