mirror of https://github.com/layui/layui
fix: 修复 nav 在 IE 中的兼容性问题 (#2415)
* fix(nav): 导航菜单在 IE 中的兼容性问题 * treeTable(test): 添加 IE 测试pull/2426/head
parent
e0a806449b
commit
0356e805d2
|
@ -26,6 +26,53 @@
|
|||
|
||||
<script src="../src/layui.js"></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(){
|
||||
var treeTable = layui.treeTable;
|
||||
var dropdown = layui.dropdown;
|
||||
|
|
|
@ -519,8 +519,8 @@ layui.define('jquery', function(exports){
|
|||
var itemElem = othis.find('.'+NAV_ITEM);
|
||||
|
||||
// hover 滑动效果
|
||||
var hasBarElem = othis.find('.'+NAV_BAR)[0];
|
||||
if (hasBarElem) hasBarElem.remove();
|
||||
var hasBarElem = othis.find('.'+NAV_BAR);
|
||||
if (hasBarElem[0]) hasBarElem.remove();
|
||||
othis.append(bar);
|
||||
( othis.hasClass(NAV_TREE)
|
||||
? itemElem.find('dd,>.'+ NAV_TITLE)
|
||||
|
|
Loading…
Reference in New Issue