mirror of
https://gitee.com/layui/layui.git
synced 2025-06-28 13:34:27 +08:00
fix: 修复 nav 在 IE 中的兼容性问题 (#2415)
* fix(nav): 导航菜单在 IE 中的兼容性问题 * treeTable(test): 添加 IE 测试
This commit is contained in:
parent
e0a806449b
commit
0356e805d2
@ -26,6 +26,53 @@
|
|||||||
|
|
||||||
<script src="../src/layui.js"></script>
|
<script src="../src/layui.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
// IE8 support
|
||||||
|
// ES5 15.4.4.19 Array.prototype.map ( callbackfn [ , thisArg ] )
|
||||||
|
// From https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/Map
|
||||||
|
if (!Array.prototype.map) {
|
||||||
|
Array.prototype.map = function (fun /*, thisp */) {
|
||||||
|
if (this === void 0 || this === null) { throw TypeError(); }
|
||||||
|
|
||||||
|
var t = Object(this);
|
||||||
|
var len = t.length >>> 0;
|
||||||
|
if (typeof fun !== "function") { throw TypeError(); }
|
||||||
|
|
||||||
|
var res = []; res.length = len;
|
||||||
|
var thisp = arguments[1], i;
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
if (i in t) {
|
||||||
|
res[i] = fun.call(thisp, t[i], i, t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// ES5 15.4.4.20 Array.prototype.filter ( callbackfn [ , thisArg ] )
|
||||||
|
// From https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/Filter
|
||||||
|
if (!Array.prototype.filter) {
|
||||||
|
Array.prototype.filter = function (fun /*, thisp */) {
|
||||||
|
if (this === void 0 || this === null) { throw TypeError(); }
|
||||||
|
|
||||||
|
var t = Object(this);
|
||||||
|
var len = t.length >>> 0;
|
||||||
|
if (typeof fun !== "function") { throw TypeError(); }
|
||||||
|
|
||||||
|
var res = [];
|
||||||
|
var thisp = arguments[1], i;
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
if (i in t) {
|
||||||
|
var val = t[i]; // in case fun mutates this
|
||||||
|
if (fun.call(thisp, val, i, t)) {
|
||||||
|
res.push(val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
}
|
||||||
layui.use(['treeTable', 'dropdown', 'layer'], function(){
|
layui.use(['treeTable', 'dropdown', 'layer'], function(){
|
||||||
var treeTable = layui.treeTable;
|
var treeTable = layui.treeTable;
|
||||||
var dropdown = layui.dropdown;
|
var dropdown = layui.dropdown;
|
||||||
|
@ -519,8 +519,8 @@ layui.define('jquery', function(exports){
|
|||||||
var itemElem = othis.find('.'+NAV_ITEM);
|
var itemElem = othis.find('.'+NAV_ITEM);
|
||||||
|
|
||||||
// hover 滑动效果
|
// hover 滑动效果
|
||||||
var hasBarElem = othis.find('.'+NAV_BAR)[0];
|
var hasBarElem = othis.find('.'+NAV_BAR);
|
||||||
if (hasBarElem) hasBarElem.remove();
|
if (hasBarElem[0]) hasBarElem.remove();
|
||||||
othis.append(bar);
|
othis.append(bar);
|
||||||
( othis.hasClass(NAV_TREE)
|
( othis.hasClass(NAV_TREE)
|
||||||
? itemElem.find('dd,>.'+ NAV_TITLE)
|
? itemElem.find('dd,>.'+ NAV_TITLE)
|
||||||
|
Loading…
Reference in New Issue
Block a user