chore: update
This commit is contained in:
@@ -1072,7 +1072,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-nav .layui-nav-item{position: relative; display: inline-block; *display: inline; *zoom: 1; vertical-align: middle; line-height: 60px;}
|
||||
.layui-nav .layui-nav-item a{display: block; padding: 0 20px; color: #fff; color: rgba(255,255,255,.7); transition: all .3s; -webkit-transition: all .3s;}
|
||||
.layui-nav-bar,
|
||||
.layui-nav .layui-this:after{content: ""; position: absolute; left: 0; top: 0; width: 0; height: 5px; background-color: #5FB878; transition: all .2s; -webkit-transition: all .2s;}
|
||||
.layui-nav .layui-this:after{content: ""; position: absolute; left: 0; top: 0; width: 0; height: 5px; background-color: #5FB878; transition: all .2s; -webkit-transition: all .2s; pointer-events: none;}
|
||||
.layui-nav-bar{z-index: 1000;}
|
||||
.layui-nav[lay-bar="disabled"] .layui-nav-bar{display: none;}
|
||||
.layui-nav[lay-bar="disabled"].layui-this:after{}
|
||||
@@ -1099,7 +1099,8 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-nav-tree .layui-nav-item{display: block; width: 100%; line-height: 40px;}
|
||||
.layui-nav-tree .layui-nav-item a{position: relative; height: 40px; line-height: 40px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.layui-nav-tree .layui-nav-item>a{padding-top: 5px; padding-bottom: 5px;}
|
||||
.layui-nav-tree .layui-nav-more{right: 15px; padding: 6px 0;}
|
||||
.layui-nav-tree .layui-nav-more{right: 15px;}
|
||||
.layui-nav-tree .layui-nav-item>a .layui-nav-more{padding: 5px 0;}
|
||||
.layui-nav-tree .layui-nav-bar{width: 5px; height: 0;}
|
||||
.layui-side .layui-nav-tree .layui-nav-bar{width: 2px;}
|
||||
.layui-nav-tree .layui-this,
|
||||
|
||||
80
src/layui.js
80
src/layui.js
@@ -1,14 +1,14 @@
|
||||
|
||||
/*!
|
||||
* layui
|
||||
* Classic modular front-end ui framework
|
||||
* Layui
|
||||
* Classic modular Front-End UI library
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
;!function(win){
|
||||
"use strict";
|
||||
|
||||
var doc = document, config = {
|
||||
var doc = win.document, config = {
|
||||
modules: {} //记录模块物理路径
|
||||
,status: {} //记录模块加载状态
|
||||
,timeout: 10 //符合规范的模块请求最长等待秒数
|
||||
@@ -16,11 +16,11 @@
|
||||
}
|
||||
|
||||
,Layui = function(){
|
||||
this.v = '2.6.6'; //版本号
|
||||
this.v = '2.6.7'; //版本号
|
||||
}
|
||||
|
||||
//识别预先可能定义的指定全局对象
|
||||
,GLOBAL = window.LAYUI_GLOBAL || {}
|
||||
,GLOBAL = win.LAYUI_GLOBAL || {}
|
||||
|
||||
//获取 layui 所在目录
|
||||
,getPath = function(){
|
||||
@@ -125,7 +125,7 @@
|
||||
}();
|
||||
|
||||
//如果页面已经存在 jQuery 1.7+ 库且所定义的模块依赖 jQuery,则不加载内部 jquery 模块
|
||||
if(window.jQuery && jQuery.fn.on){
|
||||
if(win.jQuery && jQuery.fn.on){
|
||||
that.each(apps, function(index, item){
|
||||
if(item === 'jquery'){
|
||||
apps.splice(index, 1);
|
||||
@@ -537,29 +537,64 @@
|
||||
Layui.prototype.hint = function(){
|
||||
return {
|
||||
error: error
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//typeof 类型细分 -> string/number/boolean/undefined/null、object/array/function/…
|
||||
Layui.prototype._typeof = function(operand){
|
||||
if(operand === null) return String(operand);
|
||||
|
||||
//细分引用类型
|
||||
return (typeof operand === 'object' || typeof operand === 'function') ? function(){
|
||||
var type = Object.prototype.toString.call(operand).match(/\s(.+)\]$/) || [] //匹配类型字符
|
||||
,classType = 'Function|Array|Date|RegExp|Object|Error|Symbol'; //常见类型字符
|
||||
|
||||
type = type[1] || 'Object';
|
||||
|
||||
//除匹配到的类型外,其他对象均返回 object
|
||||
return new RegExp('\\b('+ classType + ')\\b').test(type)
|
||||
? type.toLowerCase()
|
||||
: 'object';
|
||||
}() : typeof operand;
|
||||
};
|
||||
|
||||
//对象是否具备数组结构(此处为兼容 jQuery 对象)
|
||||
Layui.prototype._isArray = function(obj){
|
||||
var that = this
|
||||
,len
|
||||
,type = that._typeof(obj);
|
||||
|
||||
if(!obj || (typeof obj !== 'object') || obj === win) return false;
|
||||
|
||||
len = 'length' in obj && obj.length; //兼容 ie
|
||||
return type === 'array' || len === 0 || (
|
||||
typeof len === 'number' && len > 0 && (len - 1) in obj //兼容 jQuery 对象
|
||||
);
|
||||
};
|
||||
|
||||
//遍历
|
||||
Layui.prototype.each = function(obj, fn){
|
||||
var key
|
||||
,that = this
|
||||
,callFn = function(key, obj){
|
||||
,callFn = function(key, obj){ //回调
|
||||
return fn.call(obj[key], key, obj[key])
|
||||
};
|
||||
|
||||
if(typeof fn !== 'function') return that;
|
||||
obj = obj || [];
|
||||
|
||||
if(obj.constructor === Object){
|
||||
for(key in obj){
|
||||
if(callFn(key, obj)) break;
|
||||
}
|
||||
} else {
|
||||
//优先处理数组结构
|
||||
if(that._isArray(obj)){
|
||||
for(key = 0; key < obj.length; key++){
|
||||
if(callFn(key, obj)) break;
|
||||
}
|
||||
} else {
|
||||
for(key in obj){
|
||||
if(callFn(key, obj)) break;
|
||||
}
|
||||
}
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
@@ -571,7 +606,7 @@
|
||||
|
||||
if(!key) return clone;
|
||||
|
||||
//如果是数字,按大小排序,如果是非数字,按字典序排序
|
||||
//如果是数字,按大小排序;如果是非数字,则按字典序排序
|
||||
clone.sort(function(o1, o2){
|
||||
var isNum = /^-?\d+$/
|
||||
,v1 = o1[key]
|
||||
@@ -579,7 +614,10 @@
|
||||
|
||||
if(isNum.test(v1)) v1 = parseFloat(v1);
|
||||
if(isNum.test(v2)) v2 = parseFloat(v2);
|
||||
|
||||
return v1 - v2;
|
||||
|
||||
/*
|
||||
if(v1 && !v2){
|
||||
return 1;
|
||||
} else if(!v1 && v2){
|
||||
@@ -593,6 +631,8 @@
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
});
|
||||
|
||||
desc && clone.reverse(); //倒序
|
||||
@@ -606,6 +646,9 @@
|
||||
thisEvent.cancelBubble = true;
|
||||
}
|
||||
};
|
||||
|
||||
//字符常理
|
||||
var EV_REMOVE = 'LAYUI-EVENT-REMOVE';
|
||||
|
||||
//自定义模块事件
|
||||
Layui.prototype.onevent = function(modName, events, callback){
|
||||
@@ -628,7 +671,7 @@
|
||||
};
|
||||
|
||||
//如果参数传入特定字符,则执行移除事件
|
||||
if(params === 'LAYUI-EVENT-REMOVE'){
|
||||
if(params === EV_REMOVE){
|
||||
delete (that.cache.event[eventName] || {})[filterName];
|
||||
return that;
|
||||
}
|
||||
@@ -668,10 +711,11 @@
|
||||
//移除模块事件
|
||||
Layui.prototype.off = function(events, modName){
|
||||
var that = this;
|
||||
return that.event.call(that, modName, events, 'LAYUI-EVENT-REMOVE');
|
||||
return that.event.call(that, modName, events, EV_REMOVE);
|
||||
};
|
||||
|
||||
|
||||
//exports layui
|
||||
win.layui = new Layui();
|
||||
|
||||
}(window);
|
||||
}(window); //gulp build: layui-footer
|
||||
|
||||
|
||||
@@ -71,8 +71,9 @@ layui.define([''], function(exports){
|
||||
Class.prototype.reload = function(options){
|
||||
var that = this;
|
||||
|
||||
//防止数组深度合并
|
||||
layui.each(options, function(key, item){
|
||||
if(item.constructor === Array) delete that.config[key];
|
||||
if(layui._typeof(item) === 'array') delete that.config[key];
|
||||
});
|
||||
|
||||
that.config = $.extend(true, {}, that.config, options);
|
||||
|
||||
@@ -258,7 +258,7 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
||||
|
||||
//阻止全局事件
|
||||
that.elemView.find('.layui-menu').on(clickOrMousedown, function(e){
|
||||
lay.stope(e);
|
||||
layui.stope(e);
|
||||
});
|
||||
|
||||
//触发菜单列表事件
|
||||
|
||||
@@ -100,7 +100,7 @@ layui.define('jquery', function(exports){
|
||||
|
||||
//基础事件体
|
||||
,call = {
|
||||
//Tab点击
|
||||
//Tab 点击
|
||||
tabClick: function(e, index, liElem, options){
|
||||
options = options || {};
|
||||
var othis = liElem || $(this)
|
||||
@@ -108,9 +108,12 @@ layui.define('jquery', function(exports){
|
||||
,parents = options.headerElem ? othis.parent() : othis.parents('.layui-tab').eq(0)
|
||||
,item = options.bodyElem ? $(options.bodyElem) : parents.children('.layui-tab-content').children('.layui-tab-item')
|
||||
,elemA = othis.find('a')
|
||||
,isJump = elemA.attr('href') !== 'javascript:;' && elemA.attr('target') === '_blank' //是否存在跳转
|
||||
,unselect = typeof othis.attr('lay-unselect') === 'string' //是否禁用选中
|
||||
,filter = parents.attr('lay-filter');
|
||||
|
||||
if(!(elemA.attr('href') !== 'javascript:;' && elemA.attr('target') === '_blank')){
|
||||
|
||||
//执行切换
|
||||
if(!(isJump || unselect)){
|
||||
othis.addClass(THIS).siblings().removeClass(THIS);
|
||||
item.eq(index).addClass(SHOW).siblings().removeClass(SHOW);
|
||||
}
|
||||
@@ -229,7 +232,7 @@ layui.define('jquery', function(exports){
|
||||
,filter = parents.attr('lay-filter')
|
||||
,parent = othis.parent()
|
||||
,child = othis.siblings('.'+NAV_CHILD)
|
||||
,unselect = typeof parent.attr('lay-unselect') === 'string';
|
||||
,unselect = typeof parent.attr('lay-unselect') === 'string'; //是否禁用选中
|
||||
|
||||
if(!(othis.attr('href') !== 'javascript:;' && othis.attr('target') === '_blank') && !unselect){
|
||||
if(!child[0]){
|
||||
@@ -310,12 +313,15 @@ layui.define('jquery', function(exports){
|
||||
,follow = function(bar, nav, index){
|
||||
var othis = $(this), child = othis.find('.'+NAV_CHILD);
|
||||
if(nav.hasClass(NAV_TREE)){
|
||||
var thisA = othis.children('.'+ NAV_TITLE);
|
||||
bar.css({
|
||||
top: othis.offset().top - nav.offset().top
|
||||
,height: (thisA[0] ? thisA : othis).outerHeight()
|
||||
,opacity: 1
|
||||
});
|
||||
//无子菜单时跟随
|
||||
if(!child[0]){
|
||||
var thisA = othis.children('.'+ NAV_TITLE);
|
||||
bar.css({
|
||||
top: othis.offset().top - nav.offset().top
|
||||
,height: (thisA[0] ? thisA : othis).outerHeight()
|
||||
,opacity: 1
|
||||
});
|
||||
}
|
||||
} else {
|
||||
child.addClass(NAV_ANIM);
|
||||
|
||||
@@ -325,7 +331,7 @@ layui.define('jquery', function(exports){
|
||||
});
|
||||
|
||||
//滑块定位
|
||||
if(child[0]){
|
||||
if(child[0]){ //若有子菜单,则滑块消失
|
||||
bar.css({
|
||||
left: bar.position().left + bar.width()/2
|
||||
,width: 0
|
||||
@@ -371,13 +377,15 @@ layui.define('jquery', function(exports){
|
||||
? itemElem.find('dd,>.'+ NAV_TITLE)
|
||||
: itemElem).on('mouseenter', function(){
|
||||
follow.call(this, bar, othis, index);
|
||||
}).on('mouseleave', function(){
|
||||
}).on('mouseleave', function(){ //鼠标移出
|
||||
//是否为垂直导航
|
||||
if(othis.hasClass(NAV_TREE)){
|
||||
bar.css({
|
||||
height: 0
|
||||
,opacity: 0
|
||||
});
|
||||
} else {
|
||||
//隐藏子菜单
|
||||
clearTimeout(timerMore[index]);
|
||||
timerMore[index] = setTimeout(function(){
|
||||
othis.find('.'+NAV_CHILD).removeClass(SHOW);
|
||||
|
||||
@@ -618,7 +618,7 @@ layui.define('layer', function(exports){
|
||||
,DANGER = 'layui-form-danger' //警示样式
|
||||
,field = {} //字段集合
|
||||
,button = $(this) //当前触发的按钮
|
||||
,elem = button.parents(ELEM) //当前所在表单域
|
||||
,elem = button.parents(ELEM).eq(0) //当前所在表单域
|
||||
,verifyElem = elem.find('*[lay-verify]') //获取需要校验的元素
|
||||
,formElem = button.parents('form')[0] //获取当前所在的 form 元素,如果存在的话
|
||||
,filter = button.attr('lay-filter'); //获取过滤器
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/*! lay 基础 DOM 操作 */
|
||||
/*! lay 基础 DOM 操作 | MIT Licensed */
|
||||
|
||||
;!function(){
|
||||
;!function(window){ //gulp build: lay-header
|
||||
"use strict";
|
||||
|
||||
var MOD_NAME = 'lay' //模块名
|
||||
@@ -56,58 +56,36 @@
|
||||
};
|
||||
|
||||
//lay 模块版本
|
||||
lay.v = '1.0.0';
|
||||
lay.v = '1.0.7';
|
||||
|
||||
//ie版本
|
||||
lay.ie = function(){
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
|
||||
(agent.match(/msie\s(\d+)/) || [])[1] || '11' //由于ie11并没有msie的标识
|
||||
(agent.match(/msie\s(\d+)/) || [])[1] || '11' //由于 ie11 并没有 msie 的标识
|
||||
) : false;
|
||||
}();
|
||||
|
||||
//获取当前 JS 所在目录
|
||||
lay.getPath = function(){
|
||||
var jsPath = document.currentScript ? document.currentScript.src : function(){
|
||||
var js = document.scripts
|
||||
,last = js.length - 1
|
||||
,src;
|
||||
for(var i = last; i > 0; i--){
|
||||
if(js[i].readyState === 'interactive'){
|
||||
src = js[i].src;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return src || js[last].src;
|
||||
}();
|
||||
return jsPath.substring(0, jsPath.lastIndexOf('/') + 1);
|
||||
}
|
||||
|
||||
//中止冒泡
|
||||
lay.stope = function(e){
|
||||
e = e || window.event;
|
||||
e.stopPropagation
|
||||
? e.stopPropagation()
|
||||
: e.cancelBubble = true;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取 layui 常见方法,以便用于组件单独版
|
||||
*/
|
||||
|
||||
lay.layui = layui;
|
||||
lay.getPath = layui.cache.dir; //获取当前 JS 所在目录
|
||||
lay.stope = layui.stope; //中止冒泡
|
||||
lay.each = function(){ //遍历
|
||||
layui.each.apply(layui, arguments);
|
||||
return this;
|
||||
};
|
||||
|
||||
//对象遍历
|
||||
lay.each = function(obj, fn){
|
||||
var key
|
||||
,that = this;
|
||||
if(typeof fn !== 'function') return that;
|
||||
obj = obj || [];
|
||||
if(obj.constructor === Object){
|
||||
for(key in obj){
|
||||
if(fn.call(obj[key], key, obj[key])) break;
|
||||
}
|
||||
} else {
|
||||
for(key = 0; key < obj.length; key++){
|
||||
if(fn.call(obj[key], key, obj[key])) break;
|
||||
}
|
||||
}
|
||||
return that;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//数字前置补零
|
||||
lay.digit = function(num, length, end){
|
||||
@@ -128,62 +106,7 @@
|
||||
});
|
||||
return elem;
|
||||
};
|
||||
|
||||
//获取节点的 style 属性值
|
||||
lay.getStyle = function(node, name){
|
||||
var style = node.currentStyle ? node.currentStyle : window.getComputedStyle(node, null);
|
||||
return style[style.getPropertyValue ? 'getPropertyValue' : 'getAttribute'](name);
|
||||
};
|
||||
|
||||
//载入 CSS 依赖
|
||||
lay.link = function(href, fn, cssname){
|
||||
var head = document.getElementsByTagName("head")[0]
|
||||
,link = document.createElement('link');
|
||||
|
||||
if(typeof fn === 'string') cssname = fn;
|
||||
|
||||
var app = (cssname || href).replace(/\.|\//g, '');
|
||||
var id = 'layuicss-'+ app
|
||||
,STAUTS_NAME = 'creating'
|
||||
,timeout = 0;
|
||||
|
||||
|
||||
|
||||
link.rel = 'stylesheet';
|
||||
link.href = href;
|
||||
link.id = id;
|
||||
|
||||
if(!document.getElementById(id)){
|
||||
head.appendChild(link);
|
||||
}
|
||||
|
||||
if(typeof fn !== 'function') return;
|
||||
|
||||
//轮询 css 是否加载完毕
|
||||
(function poll(status) {
|
||||
var delay = 100
|
||||
,getLinkElem = document.getElementById(id); //获取动态插入的 link 元素
|
||||
|
||||
//如果轮询超过指定秒数,则视为请求文件失败或 css 文件不符合规范
|
||||
if(++timeout > 10 * 1000 / delay){
|
||||
return window.console && console.error(app +'.css: Invalid');
|
||||
};
|
||||
|
||||
//css 加载就绪
|
||||
if(parseInt(lay.getStyle(getLinkElem, 'width')) === 1989){
|
||||
//如果参数来自于初始轮询(即未加载就绪时的),则移除 link 标签状态
|
||||
if(status === STAUTS_NAME) getLinkElem.removeAttribute('lay-status');
|
||||
//如果 link 标签的状态仍为「创建中」,则继续进入轮询,直到状态改变,则执行回调
|
||||
getLinkElem.getAttribute('lay-status') === STAUTS_NAME ? setTimeout(poll, delay) : fn();
|
||||
} else {
|
||||
getLinkElem.setAttribute('lay-status', STAUTS_NAME);
|
||||
setTimeout(function(){
|
||||
poll(STAUTS_NAME);
|
||||
}, delay);
|
||||
}
|
||||
}());
|
||||
};
|
||||
|
||||
//当前页面是否存在滚动条
|
||||
lay.hasScrollbar = function(){
|
||||
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight);
|
||||
@@ -482,5 +405,5 @@
|
||||
});
|
||||
}
|
||||
|
||||
}();
|
||||
}(window, window.document);
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
|
||||
/*!
|
||||
* layDate 日期与时间控件
|
||||
* MIT Licensed
|
||||
*/
|
||||
/*! layDate 日期与时间控件 | MIT Licensed */
|
||||
|
||||
;!function(window){
|
||||
;!function(window, document){
|
||||
"use strict";
|
||||
|
||||
var isLayui = window.layui && layui.define, ready = {
|
||||
getPath: (window.lay && lay.getPath) ? lay.getPath() : ''
|
||||
getPath: (window.lay && lay.getPath) ? lay.getPath : ''
|
||||
|
||||
//载入 CSS 依赖
|
||||
,link: function(href, fn, cssname){
|
||||
@@ -17,8 +14,8 @@
|
||||
if(!laydate.path) return;
|
||||
|
||||
//加载 css
|
||||
if(window.lay && lay.link){
|
||||
lay.link(laydate.path + href, fn, cssname);
|
||||
if(window.lay && lay.layui){
|
||||
lay.layui.link(laydate.path + href, fn, cssname);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +25,7 @@
|
||||
|
||||
//外部调用
|
||||
,laydate = {
|
||||
v: '5.3.0'
|
||||
v: '5.3.1'
|
||||
,config: {} //全局配置项
|
||||
,index: (window.laydate && window.laydate.v) ? 100000 : 0
|
||||
,path: GLOBAL.laydate_dir || ready.getPath
|
||||
@@ -681,7 +678,7 @@
|
||||
}
|
||||
};
|
||||
getEndDate();
|
||||
|
||||
|
||||
if(typeof value === 'string' && value){
|
||||
if(that.EXP_IF.test(value)){ //校验日期格式
|
||||
if(options.range){
|
||||
@@ -1060,13 +1057,7 @@
|
||||
//如果为年月选择器,点击了年列表,则切换到月选择器
|
||||
if(options.type === 'month' && type === 'year'){
|
||||
that.listYM[index][0] = ym;
|
||||
if(isAlone){
|
||||
if(index){
|
||||
dateTime.year = ym;
|
||||
} else {
|
||||
that.endDate.year = ym;
|
||||
}
|
||||
}
|
||||
isAlone && ((index ? that.endDate : dateTime).year = ym);
|
||||
that.list('month', index);
|
||||
}
|
||||
} else {
|
||||
@@ -1682,5 +1673,5 @@
|
||||
}()
|
||||
);
|
||||
|
||||
}(window);
|
||||
}(window, window.document);
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ var isLayui = window.layui && layui.define, $, win, ready = {
|
||||
|
||||
//默认内置方法。
|
||||
var layer = {
|
||||
v: '3.5.0',
|
||||
v: '3.5.1',
|
||||
ie: function(){ //ie版本
|
||||
var agent = navigator.userAgent.toLowerCase();
|
||||
return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
|
||||
@@ -1135,17 +1135,21 @@ layer.photos = function(options, loop, key){
|
||||
var dict = {};
|
||||
options = options || {};
|
||||
if(!options.photos) return;
|
||||
var type = options.photos.constructor === Object;
|
||||
var photos = type ? options.photos : {}, data = photos.data || [];
|
||||
var start = photos.start || 0;
|
||||
dict.imgIndex = (start|0) + 1;
|
||||
|
||||
//若 photos 并非选择器或 jQuery 对象,则为普通 object
|
||||
var isObject = !(typeof options.photos === 'string' || options.photos instanceof $)
|
||||
,photos = isObject ? options.photos : {}
|
||||
,data = photos.data || []
|
||||
,start = photos.start || 0;
|
||||
|
||||
dict.imgIndex = (start|0) + 1;
|
||||
options.img = options.img || 'img';
|
||||
|
||||
var success = options.success;
|
||||
delete options.success;
|
||||
|
||||
if(!type){ //页面直接获取
|
||||
|
||||
//如果 options.photos 不是一个对象
|
||||
if(!isObject){ //页面直接获取
|
||||
var parent = $(options.photos), pushData = function(){
|
||||
data = [];
|
||||
parent.find(options.img).each(function(index){
|
||||
|
||||
@@ -642,8 +642,10 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
options = options || {};
|
||||
delete that.haveInit;
|
||||
|
||||
//如果直接传入数组 data,则移除原来的数组,以免数组发生深度拷贝
|
||||
if(options.data && options.data.constructor === Array) delete that.config.data;
|
||||
//防止数组深度合并
|
||||
layui.each(options, function(key, item){
|
||||
if(layui._typeof(item) === 'array') delete that.config[key];
|
||||
});
|
||||
|
||||
//对参数进行深度或浅扩展
|
||||
that.config = $.extend(deep, {}, that.config, options);
|
||||
@@ -728,7 +730,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
typeof options.done === 'function' && options.done(res, curr, res[response.countName]);
|
||||
}
|
||||
,error: function(e, msg){
|
||||
that.errorView('数据接口请求异常:'+ msg);
|
||||
that.errorView('请求异常,错误提示:'+ msg);
|
||||
|
||||
that.renderForm();
|
||||
that.setColsWidth();
|
||||
@@ -1203,12 +1205,12 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
if(options.totalRow){
|
||||
bodyHeight = bodyHeight - (that.layTotal.outerHeight() || 40);
|
||||
}
|
||||
|
||||
|
||||
//减去分页栏的高度
|
||||
if(options.page){
|
||||
bodyHeight = bodyHeight - (that.layPage.outerHeight() || 41);
|
||||
}
|
||||
|
||||
|
||||
that.layMain.css('height', bodyHeight - 2);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user