优化js语法,提高兼容性

This commit is contained in:
augushong
2024-06-01 09:36:56 +08:00
parent fee373f423
commit 592bc66704
2 changed files with 7 additions and 7 deletions

View File

@@ -50,7 +50,7 @@
'<iframe width="100%" height="100%" frameborder="no" border="0" marginwidth="0" marginheight="0" src="' +
options.href +
'"></iframe>',
id: options.tabId,
id: options.tabId
});
$('.layuimini-menu-left').attr('layuimini-tab-tag', 'add');
sessionStorage.setItem('layuiminimenu_' + options.tabId, options.title);
@@ -520,7 +520,7 @@
$('#' + moduleId + 'HeaderId').addClass('layui-this');
$('.layuimini-menu-left .layui-nav.layui-nav-tree').attr(
'class',
'layui-nav layui-nav-tree layui-hide',
'layui-nav layui-nav-tree layui-hide'
);
$('#' + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
} else {
@@ -534,7 +534,7 @@
$('#' + moduleId + 'HeaderId').addClass('layui-this');
$('.layuimini-menu-left .layui-nav.layui-nav-tree').attr(
'class',
'layui-nav layui-nav-tree layui-hide',
'layui-nav layui-nav-tree layui-hide'
);
$('#' + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
} else {
@@ -565,7 +565,7 @@
{
scrollLeft: autoLeft - $tabTitle.width() / 3,
},
200,
200
);
},
@@ -581,14 +581,14 @@
{
scrollLeft: left - 450,
},
200,
200
);
} else {
$tabTitle.animate(
{
scrollLeft: left + 450,
},
200,
200
);
}
},

View File

@@ -1313,7 +1313,7 @@
//触发排序事件
table.on('sort(' + option.layFilter + ')', function (obj) { //注sort 是工具条事件名test 是 table 原始容器的属性 lay-filter="对应的值"
var lastWhere = lastTableWhere[option.id] ?? {};
var lastWhere = lastTableWhere[option.id] ? lastTableWhere[option.id] : {};
lastWhere.sort = {};
lastWhere.sort[obj.field] = obj.type;