mirror of https://github.com/layui/layui
Merge branch '2.x' of github.com:layui/layui into 2.x
commit
89c5d840a9
|
@ -42,6 +42,7 @@ layui.use('dropdown', function(){
|
||||||
|
|
||||||
dropdown.render({
|
dropdown.render({
|
||||||
elem: '#demo1'
|
elem: '#demo1'
|
||||||
|
,shade: [0.1, '#ddd']
|
||||||
//,align: 'right'
|
//,align: 'right'
|
||||||
,data: [{
|
,data: [{
|
||||||
title: 'menu item 1'
|
title: 'menu item 1'
|
||||||
|
|
|
@ -152,6 +152,7 @@ layui.use('laydate', function(laydate){
|
||||||
laydate.render({
|
laydate.render({
|
||||||
elem: '#test-first',
|
elem: '#test-first',
|
||||||
min: 0,
|
min: 0,
|
||||||
|
shade: [0.1, '#ddd']
|
||||||
//max: '2016-12-30'
|
//max: '2016-12-30'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1146,7 +1146,7 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||||
/* 下拉菜单 */
|
/* 下拉菜单 */
|
||||||
.layui-dropdown{position: absolute; left: -999999px; top: -999999px; z-index: 77777777; margin: 5px 0; min-width: 100px;}
|
.layui-dropdown{position: absolute; left: -999999px; top: -999999px; z-index: 77777777; margin: 5px 0; min-width: 100px;}
|
||||||
.layui-dropdown:before{content:""; position: absolute; width: 100%; height: 6px; left: 0; top: -6px;}
|
.layui-dropdown:before{content:""; position: absolute; width: 100%; height: 6px; left: 0; top: -6px;}
|
||||||
|
.layui-dropdown-shade{top: 0; left: 0; width: 100%; height: 100%; _height: expression(document.body.offsetHeight+"px"); position: fixed; _position: absolute; pointer-events: auto;}
|
||||||
|
|
||||||
/** 导航菜单 **/
|
/** 导航菜单 **/
|
||||||
.layui-nav{position: relative; padding: 0 20px; background-color: #393D49; color: #fff; border-radius: 2px; font-size: 0; box-sizing: border-box;}
|
.layui-nav{position: relative; padding: 0 20px; background-color: #393D49; color: #fff; border-radius: 2px; font-size: 0; box-sizing: border-box;}
|
||||||
|
|
|
@ -17,6 +17,7 @@ html #layuicss-laydate{display: none; position: absolute; width: 1989px;}
|
||||||
.layui-laydate-header *,
|
.layui-laydate-header *,
|
||||||
.layui-laydate-content td,
|
.layui-laydate-content td,
|
||||||
.layui-laydate-list li{transition-duration: .3s; -webkit-transition-duration: .3s;}
|
.layui-laydate-list li{transition-duration: .3s; -webkit-transition-duration: .3s;}
|
||||||
|
.layui-laydate-shade{top: 0; left: 0; width: 100%; height: 100%; _height: expression(document.body.offsetHeight+"px"); position: fixed; _position: absolute; pointer-events: auto;}
|
||||||
|
|
||||||
/* 微微往下滑入 */
|
/* 微微往下滑入 */
|
||||||
@keyframes laydate-downbit {
|
@keyframes laydate-downbit {
|
||||||
|
|
|
@ -56,7 +56,7 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
||||||
|
|
||||||
//字符常量
|
//字符常量
|
||||||
,STR_ELEM = 'layui-dropdown', STR_HIDE = 'layui-hide', STR_DISABLED = 'layui-disabled', STR_NONE = 'layui-none'
|
,STR_ELEM = 'layui-dropdown', STR_HIDE = 'layui-hide', STR_DISABLED = 'layui-disabled', STR_NONE = 'layui-none'
|
||||||
,STR_ITEM_UP = 'layui-menu-item-up', STR_ITEM_DOWN = 'layui-menu-item-down', STR_MENU_TITLE = 'layui-menu-body-title', STR_ITEM_GROUP = 'layui-menu-item-group', STR_ITEM_PARENT = 'layui-menu-item-parent', STR_ITEM_DIV = 'layui-menu-item-divider', STR_ITEM_CHECKED = 'layui-menu-item-checked', STR_ITEM_CHECKED2 = 'layui-menu-item-checked2', STR_MENU_PANEL = 'layui-menu-body-panel', STR_MENU_PANEL_L = 'layui-menu-body-panel-left'
|
,STR_ITEM_UP = 'layui-menu-item-up', STR_ITEM_DOWN = 'layui-menu-item-down', STR_MENU_TITLE = 'layui-menu-body-title', STR_ITEM_GROUP = 'layui-menu-item-group', STR_ITEM_PARENT = 'layui-menu-item-parent', STR_ITEM_DIV = 'layui-menu-item-divider', STR_ITEM_CHECKED = 'layui-menu-item-checked', STR_ITEM_CHECKED2 = 'layui-menu-item-checked2', STR_MENU_PANEL = 'layui-menu-body-panel', STR_MENU_PANEL_L = 'layui-menu-body-panel-left', STR_ELEM_SHADE = 'layui-dropdown-shade'
|
||||||
|
|
||||||
,STR_GROUP_TITLE = '.'+ STR_ITEM_GROUP + '>.'+ STR_MENU_TITLE
|
,STR_GROUP_TITLE = '.'+ STR_ITEM_GROUP + '>.'+ STR_MENU_TITLE
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
||||||
,isSpreadItem: true //是否初始展开子菜单
|
,isSpreadItem: true //是否初始展开子菜单
|
||||||
,data: [] //菜单数据结构
|
,data: [] //菜单数据结构
|
||||||
,delay: 300 //延迟关闭的毫秒数,若 trigger 为 hover 时才生效
|
,delay: 300 //延迟关闭的毫秒数,若 trigger 为 hover 时才生效
|
||||||
|
,shade: 0 // 遮罩
|
||||||
};
|
};
|
||||||
|
|
||||||
//重载实例
|
//重载实例
|
||||||
|
@ -252,6 +253,10 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
||||||
elemBody.append(that.elemView);
|
elemBody.append(that.elemView);
|
||||||
options.elem.data(MOD_INDEX +'_opened', true);
|
options.elem.data(MOD_INDEX +'_opened', true);
|
||||||
|
|
||||||
|
//遮罩
|
||||||
|
var shade = options.shade ? ('<div class="'+ STR_ELEM_SHADE +'" style="'+ ('z-index:'+ (that.elemView.css('z-index')-1) +'; background-color: ' + (options.shade[1] || '#000') + '; opacity: ' + (options.shade[0] || options.shade)) +'"></div>') : '';
|
||||||
|
that.elemView.before(shade);
|
||||||
|
|
||||||
//坐标定位
|
//坐标定位
|
||||||
that.position();
|
that.position();
|
||||||
thisModule.prevElem = that.elemView; //记录当前打开的元素,以便在下次关闭
|
thisModule.prevElem = that.elemView; //记录当前打开的元素,以便在下次关闭
|
||||||
|
@ -324,6 +329,7 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
||||||
);
|
);
|
||||||
elemPrev.remove();
|
elemPrev.remove();
|
||||||
}
|
}
|
||||||
|
lay('.' + STR_ELEM_SHADE).remove();
|
||||||
};
|
};
|
||||||
|
|
||||||
//延迟删除视图
|
//延迟删除视图
|
||||||
|
|
|
@ -94,6 +94,7 @@
|
||||||
var ELEM_TIME_BTN = 'laydate-btns-time';
|
var ELEM_TIME_BTN = 'laydate-btns-time';
|
||||||
var ELEM_PREVIEW = 'layui-laydate-preview';
|
var ELEM_PREVIEW = 'layui-laydate-preview';
|
||||||
var ELEM_MAIN = 'layui-laydate-main';
|
var ELEM_MAIN = 'layui-laydate-main';
|
||||||
|
var ELEM_SHADE = 'layui-laydate-shade';
|
||||||
|
|
||||||
// 组件构造器
|
// 组件构造器
|
||||||
var Class = function(options){
|
var Class = function(options){
|
||||||
|
@ -163,6 +164,7 @@
|
||||||
,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发
|
,done: null //控件选择完毕后的回调,点击清空/现在/确定也均会触发
|
||||||
,change: null //日期时间改变后的回调
|
,change: null //日期时间改变后的回调
|
||||||
,autoConfirm: true //是否自动确认(日期|年份|月份选择器非range下是否自动确认)
|
,autoConfirm: true //是否自动确认(日期|年份|月份选择器非range下是否自动确认)
|
||||||
|
,shade: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
//多语言
|
//多语言
|
||||||
|
@ -641,6 +643,9 @@
|
||||||
,that.position() //定位
|
,that.position() //定位
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var shade = options.shade ? ('<div class="'+ ELEM_SHADE +'" style="'+ ('z-index:'+ (elem.style.zIndex-1) +'; background-color: ' + (options.shade[1] || '#000') + '; opacity: ' + (options.shade[0] || options.shade)) +'"></div>') : '';
|
||||||
|
elem.insertAdjacentHTML('beforebegin', shade);
|
||||||
|
|
||||||
that.checkDate().calendar(null, 0, 'init'); //初始校验
|
that.checkDate().calendar(null, 0, 'init'); //初始校验
|
||||||
that.changeEvent(); //日期切换
|
that.changeEvent(); //日期切换
|
||||||
|
|
||||||
|
@ -670,6 +675,7 @@
|
||||||
typeof options.close === 'function' && options.close(that);
|
typeof options.close === 'function' && options.close(that);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
lay('.' + ELEM_SHADE).remove();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1409,7 +1415,7 @@
|
||||||
|
|
||||||
setTimeStatus();
|
setTimeStatus();
|
||||||
scroll();
|
scroll();
|
||||||
(that.endDate || options.type === 'time') && that.done(null, 'change');
|
(that.endDate || options.type === 'time' || (options.type === 'datetime' && options.fullPanel)) && that.done(null, 'change');
|
||||||
|
|
||||||
//同步按钮可点状态
|
//同步按钮可点状态
|
||||||
that.setBtnStatus();
|
that.setBtnStatus();
|
||||||
|
|
|
@ -902,8 +902,8 @@ Class.pt.openLayer = function(){
|
||||||
//记录宽高坐标,用于还原
|
//记录宽高坐标,用于还原
|
||||||
ready.record = function(layero){
|
ready.record = function(layero){
|
||||||
var area = [
|
var area = [
|
||||||
layero.width(),
|
layero[0].style.width || layero.width(),
|
||||||
layero.height(),
|
layero[0].style.height || layero.height(),
|
||||||
layero.position().top,
|
layero.position().top,
|
||||||
layero.position().left + parseFloat(layero.css('margin-left'))
|
layero.position().left + parseFloat(layero.css('margin-left'))
|
||||||
];
|
];
|
||||||
|
@ -981,11 +981,11 @@ layer.style = function(index, options, limit){
|
||||||
|
|
||||||
if(type === ready.type[2]){
|
if(type === ready.type[2]){
|
||||||
layero.find('iframe').css({
|
layero.find('iframe').css({
|
||||||
height: parseFloat(options.height) - titHeight - btnHeight
|
height: (typeof options.height === 'number' ? options.height : layero.height()) - titHeight - btnHeight
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
contElem.css({
|
contElem.css({
|
||||||
height: parseFloat(options.height) - titHeight - btnHeight
|
height: (typeof options.height === 'number' ? options.height : layero.height()) - titHeight - btnHeight
|
||||||
- parseFloat(contElem.css('padding-top'))
|
- parseFloat(contElem.css('padding-top'))
|
||||||
- parseFloat(contElem.css('padding-bottom'))
|
- parseFloat(contElem.css('padding-bottom'))
|
||||||
})
|
})
|
||||||
|
@ -1058,8 +1058,8 @@ layer.restore = function(index){
|
||||||
|
|
||||||
//恢复原来尺寸
|
//恢复原来尺寸
|
||||||
layer.style(index, {
|
layer.style(index, {
|
||||||
width: parseFloat(area[0]),
|
width: area[0], // 数值或百分比
|
||||||
height: parseFloat(area[1]),
|
height: area[1],
|
||||||
top: parseFloat(area[2]),
|
top: parseFloat(area[2]),
|
||||||
left: parseFloat(area[3]),
|
left: parseFloat(area[3]),
|
||||||
position: layero.attr('position'),
|
position: layero.attr('position'),
|
||||||
|
|
|
@ -1363,7 +1363,8 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
tds.push(td);
|
tds.push(td);
|
||||||
});
|
});
|
||||||
|
|
||||||
that.layTotal.find('tbody').html('<tr>' + tds.join('') + '</tr>');
|
var patchElem = that.layTotal.find('.layui-table-patch'); // 可能存在滚动条补丁
|
||||||
|
that.layTotal.find('tbody').html('<tr>' + tds.join('') + (patchElem.length ? patchElem.get(0).outerHTML : '') + '</tr>');
|
||||||
};
|
};
|
||||||
|
|
||||||
//找到对应的列元素
|
//找到对应的列元素
|
||||||
|
|
|
@ -194,14 +194,15 @@ layui.define('layer' , function(exports){
|
||||||
layui.each(items, function(index, file){
|
layui.each(items, function(index, file){
|
||||||
var formData = new FormData();
|
var formData = new FormData();
|
||||||
|
|
||||||
formData.append(options.field, file);
|
|
||||||
|
|
||||||
//追加额外的参数
|
//追加额外的参数
|
||||||
layui.each(options.data, function(key, value){
|
layui.each(options.data, function(key, value){
|
||||||
value = typeof value === 'function' ? value() : value;
|
value = typeof value === 'function' ? value() : value;
|
||||||
formData.append(key, value);
|
formData.append(key, value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//最后添加 file 到表单域
|
||||||
|
formData.append(options.field, file);
|
||||||
|
|
||||||
//提交文件
|
//提交文件
|
||||||
var opts = {
|
var opts = {
|
||||||
url: options.url
|
url: options.url
|
||||||
|
|
Loading…
Reference in New Issue