|
|
@ -87,6 +87,7 @@
|
|
|
|
var ELEM_PREV = 'laydate-day-prev';
|
|
|
|
var ELEM_PREV = 'laydate-day-prev';
|
|
|
|
var ELEM_NEXT = 'laydate-day-next';
|
|
|
|
var ELEM_NEXT = 'laydate-day-next';
|
|
|
|
var ELEM_FOOTER = 'layui-laydate-footer';
|
|
|
|
var ELEM_FOOTER = 'layui-laydate-footer';
|
|
|
|
|
|
|
|
var ELEM_SHORTCUT = 'layui-laydate-shortcut';
|
|
|
|
var ELEM_NOW = '.laydate-btns-now'
|
|
|
|
var ELEM_NOW = '.laydate-btns-now'
|
|
|
|
var ELEM_CONFIRM = '.laydate-btns-confirm';
|
|
|
|
var ELEM_CONFIRM = '.laydate-btns-confirm';
|
|
|
|
var ELEM_TIME_TEXT = 'laydate-time-text';
|
|
|
|
var ELEM_TIME_TEXT = 'laydate-time-text';
|
|
|
@ -413,6 +414,11 @@
|
|
|
|
//底部区域
|
|
|
|
//底部区域
|
|
|
|
,divFooter = that.footer = lay.elem('div', {
|
|
|
|
,divFooter = that.footer = lay.elem('div', {
|
|
|
|
"class": ELEM_FOOTER
|
|
|
|
"class": ELEM_FOOTER
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//快捷栏
|
|
|
|
|
|
|
|
,divShortcut = that.shortcut = lay.elem('ul', {
|
|
|
|
|
|
|
|
"class": ELEM_SHORTCUT
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if(options.zIndex) elem.style.zIndex = options.zIndex;
|
|
|
|
if(options.zIndex) elem.style.zIndex = options.zIndex;
|
|
|
@ -522,6 +528,19 @@
|
|
|
|
return html.join('');
|
|
|
|
return html.join('');
|
|
|
|
}());
|
|
|
|
}());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//生成快捷键栏
|
|
|
|
|
|
|
|
elem.appendChild(divShortcut);
|
|
|
|
|
|
|
|
lay(divShortcut).html(function () {
|
|
|
|
|
|
|
|
var shortcutBtns = [];
|
|
|
|
|
|
|
|
lay.each(options.shortcuts, function (i, item) {
|
|
|
|
|
|
|
|
shortcutBtns.push('<li>'+item.text+'</li>')
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return shortcutBtns.join('');
|
|
|
|
|
|
|
|
}()).find('li').on('click', function (event) {
|
|
|
|
|
|
|
|
lay(this.parentElement).find('li.layui-this').removeClass(THIS);
|
|
|
|
|
|
|
|
lay(this).addClass(THIS);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
//插入到主区域
|
|
|
|
//插入到主区域
|
|
|
|
lay.each(elemMain, function(i, main){
|
|
|
|
lay.each(elemMain, function(i, main){
|
|
|
|
elem.appendChild(main);
|
|
|
|
elem.appendChild(main);
|
|
|
@ -529,11 +548,12 @@
|
|
|
|
options.showBottom && elem.appendChild(divFooter);
|
|
|
|
options.showBottom && elem.appendChild(divFooter);
|
|
|
|
|
|
|
|
|
|
|
|
//生成自定义主题
|
|
|
|
//生成自定义主题
|
|
|
|
var style;
|
|
|
|
var style = lay.elem('style');
|
|
|
|
var styleText = [];
|
|
|
|
var styleText = [];
|
|
|
|
|
|
|
|
var colorTheme;
|
|
|
|
lay.each(options.theme, function (index, theme) {
|
|
|
|
lay.each(options.theme, function (index, theme) {
|
|
|
|
if(/^#/.test(theme)){
|
|
|
|
if(/^#/.test(theme)){
|
|
|
|
style = style || lay.elem('style');
|
|
|
|
colorTheme = true;
|
|
|
|
styleText.push([
|
|
|
|
styleText.push([
|
|
|
|
'#{{id}} .layui-laydate-header{background-color:{{theme}};}'
|
|
|
|
'#{{id}} .layui-laydate-header{background-color:{{theme}};}'
|
|
|
|
,'#{{id}} li.layui-this,#{{id}} td.layui-this>div{background-color:{{theme}} !important;}'
|
|
|
|
,'#{{id}} li.layui-this,#{{id}} td.layui-this>div{background-color:{{theme}} !important;}'
|
|
|
@ -541,7 +561,11 @@
|
|
|
|
].join('').replace(/{{id}}/g, that.elemID).replace(/{{theme}}/g, theme));
|
|
|
|
].join('').replace(/{{id}}/g, that.elemID).replace(/{{theme}}/g, theme));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if (style) {
|
|
|
|
//快捷栏样式
|
|
|
|
|
|
|
|
if (options.shortcuts && options.range) {
|
|
|
|
|
|
|
|
styleText.push('#{{id}}.layui-laydate-range{width: 628px;}'.replace(/{{id}}/g, that.elemID))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (styleText.length) {
|
|
|
|
styleText = styleText.join('');
|
|
|
|
styleText = styleText.join('');
|
|
|
|
if('styleSheet' in style){
|
|
|
|
if('styleSheet' in style){
|
|
|
|
style.setAttribute('type', 'text/css');
|
|
|
|
style.setAttribute('type', 'text/css');
|
|
|
@ -550,7 +574,7 @@
|
|
|
|
style.innerHTML = styleText;
|
|
|
|
style.innerHTML = styleText;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lay(elem).addClass('laydate-theme-molv');
|
|
|
|
colorTheme && lay(elem).addClass('laydate-theme-molv');
|
|
|
|
elem.appendChild(style);
|
|
|
|
elem.appendChild(style);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|