|
|
@ -290,10 +290,8 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//设置唯一KEY
|
|
|
|
//设置唯一KEY
|
|
|
|
// if(!options.elem.attr('lay-key')){
|
|
|
|
|
|
|
|
options.elem.attr('lay-key', that.index);
|
|
|
|
options.elem.attr('lay-key', that.index);
|
|
|
|
options.eventElem.attr('lay-key', that.index);
|
|
|
|
options.eventElem.attr('lay-key', that.index);
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//记录重要日期
|
|
|
|
//记录重要日期
|
|
|
|
options.mark = lay.extend({}, (options.calendar && options.lang === 'cn') ? {
|
|
|
|
options.mark = lay.extend({}, (options.calendar && options.lang === 'cn') ? {
|
|
|
@ -514,23 +512,6 @@
|
|
|
|
options.showBottom && elem.appendChild(divFooter);
|
|
|
|
options.showBottom && elem.appendChild(divFooter);
|
|
|
|
|
|
|
|
|
|
|
|
//生成自定义主题
|
|
|
|
//生成自定义主题
|
|
|
|
// if(/^#/.test(options.theme)){
|
|
|
|
|
|
|
|
// var style = lay.elem('style')
|
|
|
|
|
|
|
|
// ,styleText = [
|
|
|
|
|
|
|
|
// '#{{id}} .layui-laydate-header{background-color:{{theme}};}'
|
|
|
|
|
|
|
|
// ,'#{{id}} .layui-this{background-color:{{theme}} !important;}'
|
|
|
|
|
|
|
|
// ].join('').replace(/{{id}}/g, that.elemID).replace(/{{theme}}/g, options.theme);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if('styleSheet' in style){
|
|
|
|
|
|
|
|
// style.setAttribute('type', 'text/css');
|
|
|
|
|
|
|
|
// style.styleSheet.cssText = styleText;
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// style.innerHTML = styleText;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// lay(elem).addClass('laydate-theme-molv');
|
|
|
|
|
|
|
|
// elem.appendChild(style);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
var style;
|
|
|
|
var style;
|
|
|
|
var styleText = [];
|
|
|
|
var styleText = [];
|
|
|
|
lay.each(options.theme, function (index, theme) {
|
|
|
|
lay.each(options.theme, function (index, theme) {
|
|
|
@ -1730,39 +1711,26 @@
|
|
|
|
var that = this
|
|
|
|
var that = this
|
|
|
|
var options = that.config
|
|
|
|
var options = that.config
|
|
|
|
|
|
|
|
|
|
|
|
//绑定呼出控件事件
|
|
|
|
|
|
|
|
// var showEvent = function(elem, bind){
|
|
|
|
|
|
|
|
// elem.on(options.trigger, function(){
|
|
|
|
|
|
|
|
// //已经打开的面板避免重新渲染
|
|
|
|
|
|
|
|
// if(laydate.thisId === options.id) return;
|
|
|
|
|
|
|
|
// bind && (that.bindElem = this);
|
|
|
|
|
|
|
|
// that.render();
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!options.elem[0] || options.elem[0].eventHandler) return;
|
|
|
|
if(!options.elem[0] || options.elem[0].eventHandler) return;
|
|
|
|
|
|
|
|
|
|
|
|
// showEvent(options.elem, 'bind');
|
|
|
|
var showEvent = function(){
|
|
|
|
// showEvent(options.eventElem);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var showFn = function(){
|
|
|
|
|
|
|
|
// 已经打开的面板避免重新渲染
|
|
|
|
// 已经打开的面板避免重新渲染
|
|
|
|
if(laydate.thisId === options.id) return;
|
|
|
|
if(laydate.thisId === options.id) return;
|
|
|
|
that.bindElem = this;
|
|
|
|
that.bindElem = this;
|
|
|
|
that.render();
|
|
|
|
that.render();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
options.elem.on(options.trigger, showFn);
|
|
|
|
//绑定呼出控件事件
|
|
|
|
|
|
|
|
options.elem.on(options.trigger, showEvent);
|
|
|
|
options.elem[0].eventHandler = true;
|
|
|
|
options.elem[0].eventHandler = true;
|
|
|
|
options.eventElem.on(options.trigger, showFn);
|
|
|
|
options.eventElem.on(options.trigger, showEvent);
|
|
|
|
options.eventElem[0].eventHandler = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
that.destroy = function () {
|
|
|
|
that.destroy = function () {
|
|
|
|
that.remove();
|
|
|
|
that.remove();
|
|
|
|
layui.each(['elem', 'eventElem'], function (index, name) {
|
|
|
|
options.elem.off(options.trigger, showEvent);
|
|
|
|
options[name].off(options.trigger, showFn);
|
|
|
|
options.elem.removeAttr('lay-key');
|
|
|
|
options[name][0].eventHandler = false;
|
|
|
|
options.elem[0].eventHandler = false;
|
|
|
|
options[name].removeAttr('lay-key');
|
|
|
|
options.eventElem.off(options.trigger, showEvent);
|
|
|
|
})
|
|
|
|
options.eventElem.removeAttr('lay-key');
|
|
|
|
|
|
|
|
|
|
|
|
delete thisModule.that[options.id];
|
|
|
|
delete thisModule.that[options.id];
|
|
|
|
}
|
|
|
|
}
|
|
|
|