From 40b2cf91c70fd493d6b41d330fed7676903abeb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E7=83=88=E9=B8=9F?= <250023777@qq.com> Date: Fri, 24 Mar 2023 15:26:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E5=8D=95=E6=B5=8B=E6=8B=BC=E5=86=99?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/flow.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/flow.js b/src/modules/flow.js index 613ddf94..bb4a4bcd 100644 --- a/src/modules/flow.js +++ b/src/modules/flow.js @@ -22,7 +22,7 @@ layui.define('jquery', function(exports){ var end = options.end || '没有更多了'; //“末页”显示文案 //滚动条所在元素是否为document - var notDocment = options.scrollElem && options.scrollElem !== document; + var notDocument = options.scrollElem && options.scrollElem !== document; //加载更多 var ELEM_TEXT = '加载更多' @@ -77,10 +77,10 @@ layui.define('jquery', function(exports){ timer = setTimeout(function(){ //计算滚动所在容器的可视高度 - var height = notDocment ? othis.height() : $(window).height(); + var height = notDocument ? othis.height() : $(window).height(); //计算滚动所在容器的实际高度 - var scrollHeight = notDocment + var scrollHeight = notDocument ? othis.prop('scrollHeight') : document.documentElement.scrollHeight; @@ -103,12 +103,12 @@ layui.define('jquery', function(exports){ var elem = options.elem || 'img'; //滚动条所在元素是否为document - var notDocment = options.scrollElem && options.scrollElem !== document; + var notDocument = options.scrollElem && options.scrollElem !== document; //显示图片 var show = function(item, height){ var start = scrollElem.scrollTop(), end = start + height; - var elemTop = notDocment ? function(){ + var elemTop = notDocument ? function(){ return item.offset().top - scrollElem.offset().top + start; }() : item.offset().top; @@ -132,7 +132,7 @@ layui.define('jquery', function(exports){ }, render = function(othis, scroll){ //计算滚动所在容器的可视高度 - var height = notDocment ? (scroll||scrollElem).height() : $(window).height(); + var height = notDocument ? (scroll||scrollElem).height() : $(window).height(); var start = scrollElem.scrollTop(), end = start + height; that.lazyimg.elem = $(elem); @@ -142,7 +142,7 @@ layui.define('jquery', function(exports){ } else { //计算未加载过的图片 for(var i = 0; i < that.lazyimg.elem.length; i++){ - var item = that.lazyimg.elem.eq(i), elemTop = notDocment ? function(){ + var item = that.lazyimg.elem.eq(i), elemTop = notDocument ? function(){ return item.offset().top - scrollElem.offset().top + start; }() : item.offset().top; From 0c4e01f5333008b06f2ec4913a30bec15d2b429b Mon Sep 17 00:00:00 2001 From: yyhyd <906739148@qq.com> Date: Thu, 30 Mar 2023 11:01:50 +0800 Subject: [PATCH 2/2] fix spelling --- src/modules/laydate.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/laydate.js b/src/modules/laydate.js index 72bc7b5b..406a926b 100644 --- a/src/modules/laydate.js +++ b/src/modules/laydate.js @@ -1032,7 +1032,7 @@ var that = this; var options = that.config; - var timestrap = {} + var timestamp = {} var dateTime = opts.index > (opts.time ? 0 : 41) ? that.endDate : options.dateTime; var isOut; @@ -1041,7 +1041,7 @@ ,min: options.min ,max: options.max }, function(key, item){ - timestrap[key] = that.newDate(lay.extend({ + timestamp[key] = that.newDate(lay.extend({ year: item.year ,month: opts.type === 'year' ? 0 : item.month // 年份的时候只比较年 ,date: (opts.type === 'year' || opts.type === 'month') ? 1 : item.date // 年月只比较年月不与最大最小比日期 @@ -1054,7 +1054,7 @@ }())).getTime(); //time:是否比较时分秒 }); - isOut = timestrap.now < timestrap.min || timestrap.now > timestrap.max; + isOut = timestamp.now < timestamp.min || timestamp.now > timestamp.max; opts.elem && opts.elem[isOut ? 'addClass' : 'removeClass'](DISABLED); return isOut;