@better-scroll/observe-image
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -9,6 +9,6 @@ /*! | ||
var ua = inBrowser && navigator.userAgent.toLowerCase(); | ||
var isWeChatDevTools = !!(ua && /wechatdevtools/.test(ua)); | ||
var isAndroid = ua && ua.indexOf('android') > 0; | ||
!!(ua && /wechatdevtools/.test(ua)); | ||
ua && ua.indexOf('android') > 0; | ||
/* istanbul ignore next */ | ||
var isIOSBadVersion = (function () { | ||
((function () { | ||
if (typeof ua === 'string') { | ||
@@ -26,3 +26,3 @@ var regex = /os (\d\d?_\d(_\d)?)/; | ||
return false; | ||
})(); | ||
}))(); | ||
/* istanbul ignore next */ | ||
@@ -117,7 +117,7 @@ var supportsPassive = false; | ||
} | ||
var cssVendor = vendor && vendor !== 'standard' ? '-' + vendor.toLowerCase() + '-' : ''; | ||
vendor && vendor !== 'standard' ? '-' + vendor.toLowerCase() + '-' : ''; | ||
var transform = prefixStyle('transform'); | ||
var transition = prefixStyle('transition'); | ||
var hasPerspective = inBrowser && prefixStyle('perspective') in elementStyle; | ||
var style = { | ||
inBrowser && prefixStyle('perspective') in elementStyle; | ||
({ | ||
transform: transform, | ||
@@ -131,3 +131,3 @@ transition: transition, | ||
transitionProperty: prefixStyle('transitionProperty'), | ||
}; | ||
}); | ||
@@ -134,0 +134,0 @@ var EventRegister = /** @class */ (function () { |
@@ -15,6 +15,6 @@ /*! | ||
var ua = inBrowser && navigator.userAgent.toLowerCase(); | ||
var isWeChatDevTools = !!(ua && /wechatdevtools/.test(ua)); | ||
var isAndroid = ua && ua.indexOf('android') > 0; | ||
!!(ua && /wechatdevtools/.test(ua)); | ||
ua && ua.indexOf('android') > 0; | ||
/* istanbul ignore next */ | ||
var isIOSBadVersion = (function () { | ||
((function () { | ||
if (typeof ua === 'string') { | ||
@@ -32,3 +32,3 @@ var regex = /os (\d\d?_\d(_\d)?)/; | ||
return false; | ||
})(); | ||
}))(); | ||
/* istanbul ignore next */ | ||
@@ -123,7 +123,7 @@ var supportsPassive = false; | ||
} | ||
var cssVendor = vendor && vendor !== 'standard' ? '-' + vendor.toLowerCase() + '-' : ''; | ||
vendor && vendor !== 'standard' ? '-' + vendor.toLowerCase() + '-' : ''; | ||
var transform = prefixStyle('transform'); | ||
var transition = prefixStyle('transition'); | ||
var hasPerspective = inBrowser && prefixStyle('perspective') in elementStyle; | ||
var style = { | ||
inBrowser && prefixStyle('perspective') in elementStyle; | ||
({ | ||
transform: transform, | ||
@@ -137,3 +137,3 @@ transition: transition, | ||
transitionProperty: prefixStyle('transitionProperty'), | ||
}; | ||
}); | ||
@@ -140,0 +140,0 @@ var EventRegister = /** @class */ (function () { |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ObserveImage=t()}(this,function(){"use strict";var r="undefined"!=typeof window,n=r&&navigator.userAgent.toLowerCase(),o=(n&&/wechatdevtools/.test(n),n&&n.indexOf("android"),function(){if("string"!=typeof n)return;var e=/os (\d\d?_\d(_\d)?)/.exec(n);if(!e)return;var t=e[1].split("_").map(function(e){return parseInt(e,10)});13===t[0]&&t[1]}(),!1);if(r){try{var e={};Object.defineProperty(e,"passive",{get:function(){o=!0}}),window.addEventListener("test-passive",function(){},e)}catch(e){}}var i=r&&document.createElement("div").style,t=function(){if(!r)return!1;for(var e=0,t=[{key:"standard",value:"transform"},{key:"webkit",value:"webkitTransform"},{key:"Moz",value:"MozTransform"},{key:"O",value:"OTransform"},{key:"ms",value:"msTransform"}];e<t.length;e++){var n=t[e];if(void 0!==i[n.value])return n.key}return!1}();function s(e){return!1===t?e:"standard"===t?"transitionEnd"===e?"transitionend":e:t+e.charAt(0).toUpperCase()+e.substr(1)}function a(e,t,n,r){var i=o?{passive:!1,capture:!!r}:!!r;e.addEventListener(t,n,i)}function d(e,t,n,r){e.removeEventListener(t,n,{capture:!!r})}t&&"standard"!==t&&t.toLowerCase();var u=s("transform"),f=s("transition"),p=(r&&s("perspective")in i,s("transitionTimingFunction"),s("transitionDuration"),s("transitionDelay"),s("transformOrigin"),s("transitionEnd"),s("transitionProperty"),c.prototype.destroy=function(){this.removeDOMEvents(),this.events=[]},c.prototype.addDOMEvents=function(){this.handleDOMEvents(a)},c.prototype.removeDOMEvents=function(){this.handleDOMEvents(d)},c.prototype.handleDOMEvents=function(t){var n=this,r=this.wrapper;this.events.forEach(function(e){t(r,e.name,n,!!e.capture)})},c.prototype.handleEvent=function(t){var n=t.type;this.events.some(function(e){return e.name===n&&(e.handler(t),!0)})},c);function c(e,t){this.wrapper=e,this.events=t,this.addDOMEvents()}function v(e){this.scroll=e,this.refreshTimer=0,this.init()}return v.prototype.init=function(){this.handleOptions(this.scroll.options.observeImage),this.bindEventsToWrapper()},v.prototype.handleOptions=function(e){void 0===e&&(e={}),e=!0===e?{}:e;this.options=function(e,t){for(var n in t)e[n]=t[n];return e}({debounceTime:100},e)},v.prototype.bindEventsToWrapper=function(){var e=this.scroll.scroller.wrapper;this.imageLoadEventRegister=new p(e,[{name:"load",handler:this.load.bind(this),capture:!0}]),this.imageErrorEventRegister=new p(e,[{name:"error",handler:this.load.bind(this),capture:!0}])},v.prototype.load=function(e){var t=this,n=e.target,r=this.options.debounceTime;n&&"img"===n.tagName.toLowerCase()&&(0===r?this.scroll.refresh():(clearTimeout(this.refreshTimer),this.refreshTimer=window.setTimeout(function(){t.scroll.refresh()},this.options.debounceTime)))},v.pluginName="observeImage",v}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ObserveImage=t()}(this,function(){"use strict";var r="undefined"!=typeof window,t=r&&navigator.userAgent.toLowerCase();t&&/wechatdevtools/.test(t),t&&t.indexOf("android"),function(){if("string"==typeof t){var e=/os (\d\d?_\d(_\d)?)/.exec(t);if(!e)return;e=e[1].split("_").map(function(e){return parseInt(e,10)});13===e[0]&&e[1]}}();var i=!1;if(r)try{var e={};Object.defineProperty(e,"passive",{get:function(){i=!0}}),window.addEventListener("test-passive",function(){},e)}catch(e){}var o=r&&document.createElement("div").style,n=function(){if(!r)return!1;for(var e=0,t=[{key:"standard",value:"transform"},{key:"webkit",value:"webkitTransform"},{key:"Moz",value:"MozTransform"},{key:"O",value:"OTransform"},{key:"ms",value:"msTransform"}];e<t.length;e++){var n=t[e];if(void 0!==o[n.value])return n.key}return!1}();function s(e){return!1===n?e:"standard"===n?"transitionEnd"===e?"transitionend":e:n+e.charAt(0).toUpperCase()+e.substr(1)}function a(e,t,n,r){r=i?{passive:!1,capture:!!r}:!!r;e.addEventListener(t,n,r)}function d(e,t,n,r){e.removeEventListener(t,n,{capture:!!r})}n&&"standard"!==n&&n.toLowerCase();s("transform"),s("transition");r&&s("perspective")in o,s("transitionTimingFunction"),s("transitionDuration"),s("transitionDelay"),s("transformOrigin"),s("transitionEnd"),s("transitionProperty");var u=(f.prototype.destroy=function(){this.removeDOMEvents(),this.events=[]},f.prototype.addDOMEvents=function(){this.handleDOMEvents(a)},f.prototype.removeDOMEvents=function(){this.handleDOMEvents(d)},f.prototype.handleDOMEvents=function(t){var n=this,r=this.wrapper;this.events.forEach(function(e){t(r,e.name,n,!!e.capture)})},f.prototype.handleEvent=function(t){var n=t.type;this.events.some(function(e){return e.name===n&&(e.handler(t),!0)})},f);function f(e,t){this.wrapper=e,this.events=t,this.addDOMEvents()}function p(e){this.scroll=e,this.refreshTimer=0,this.init()}return p.prototype.init=function(){this.handleOptions(this.scroll.options.observeImage),this.bindEventsToWrapper()},p.prototype.handleOptions=function(e){this.options=function(e,t){for(var n in t)e[n]=t[n];return e}({debounceTime:100},e=!0===(e=void 0===e?{}:e)?{}:e)},p.prototype.bindEventsToWrapper=function(){var e=this.scroll.scroller.wrapper;this.imageLoadEventRegister=new u(e,[{name:"load",handler:this.load.bind(this),capture:!0}]),this.imageErrorEventRegister=new u(e,[{name:"error",handler:this.load.bind(this),capture:!0}])},p.prototype.load=function(e){var t=this,n=e.target,e=this.options.debounceTime;n&&"img"===n.tagName.toLowerCase()&&(0===e?this.scroll.refresh():(clearTimeout(this.refreshTimer),this.refreshTimer=window.setTimeout(function(){t.scroll.refresh()},this.options.debounceTime)))},p.pluginName="observeImage",p}); |
{ | ||
"name": "@better-scroll/observe-image", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "Observe image loading for BetterScroll", | ||
@@ -31,5 +31,5 @@ "author": "theniceangel <theniceangel@163.com>", | ||
"dependencies": { | ||
"@better-scroll/core": "^2.4.0" | ||
"@better-scroll/core": "^2.4.1" | ||
}, | ||
"gitHead": "a33d24e10d2d6cb431a29f9b356274845f3c3787" | ||
"gitHead": "60637c0ad50b0810156f9bfb8a2c7306493e5026" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24440
Updated@better-scroll/core@^2.4.1