代码优化完善

pull/1316/head
火烈鸟 1 year ago
parent 35c2fa101d
commit da711a38cc

@ -294,7 +294,7 @@ layui.define(['lay', 'util', 'element', 'form'], function(exports){
// header
var headerElem = $('<div class="'+ CONST.ELEM_TITLE +'">');
// 添加组件 clasName
// 添加组件 className
othis.addClass('layui-code-view layui-box');
// 自定义风格

@ -214,7 +214,7 @@ layui.define(['jquery', 'lay'], function(exports){
,'</div>'].join(''))
//初始化颜色选择框
var elem = options.elem = $(options.elem);
elem = options.elem = $(options.elem);
options.size && elemColorBox.addClass('layui-colorpicker-'+ options.size); //初始化颜色选择框尺寸
// 插入颜色选择框

@ -61,7 +61,7 @@ layui.define('jquery', function(exports){
//如果允许图片懒加载
if(options.isLazyimg){
var lazyimg = that.lazyimg({
lazyimg = that.lazyimg({
elem: options.elem + ' img'
,scrollElem: options.scrollElem
});

@ -1128,9 +1128,9 @@
//日历表
Class.prototype.calendar = function(value, index, type){
index = index ? 1 : 0;
var that = this
,options = that.config
,index = index ? 1 : 0
,dateTime = value || that.thisDateTime(index)
,thisDate = new Date(), startWeek, prevMaxDate, thisMaxDate
,lang = that.lang()
@ -1156,7 +1156,7 @@
//赋值日
lay.each(tds, function(index_, item){
var YMD = [dateTime.year, dateTime.month], st = 0;
var YMD = [dateTime.year, dateTime.month], st;
item = lay(item);
item.removeAttr("class");
if(index_ < startWeek){
@ -1971,7 +1971,7 @@
,elemCont = that.elemCont[index || 0]
,listYM = that.listYM[index]
,addSubYeay = function(type){
,addSubYear = function(type){
var isYear = lay(elemCont).find('.laydate-year-list')[0]
,isMonth = lay(elemCont).find('.laydate-month-list')[0];
@ -2006,7 +2006,7 @@
return {
prevYear: function(){
if(addSubYeay('sub')) return;
if(addSubYear('sub')) return;
if (that.rangeLinked) {
options.dateTime.year--;
that.checkDate('limit').calendar(null, null, 'init');
@ -2048,7 +2048,7 @@
}
}
,nextYear: function(){
if(addSubYeay()) return;
if(addSubYear()) return;
if (that.rangeLinked) {
options.dateTime.year++;
that.checkDate('limit').calendar(null, 0, 'init');

Loading…
Cancel
Save