@@ -61,17 +61,17 @@ module.exports =
6161/******/ __webpack_require__ . p = "./" ;
6262/******/
6363/******/ // Load entry module and return exports
64- /******/ return __webpack_require__ ( __webpack_require__ . s = 131 ) ;
64+ /******/ return __webpack_require__ ( __webpack_require__ . s = 156 ) ;
6565/******/ } )
6666/************************************************************************/
6767/******/ ( {
6868
69- /***/ 131 :
69+ /***/ 156 :
7070/***/ ( function ( module , exports , __webpack_require__ ) {
7171
7272var __WEBPACK_AMD_DEFINE_FACTORY__ , __WEBPACK_AMD_DEFINE_ARRAY__ , __WEBPACK_AMD_DEFINE_RESULT__ ; ( function ( global , factory ) {
7373 if ( true ) {
74- ! ( __WEBPACK_AMD_DEFINE_ARRAY__ = [ module , exports , __webpack_require__ ( 52 ) ] , __WEBPACK_AMD_DEFINE_FACTORY__ = ( factory ) ,
74+ ! ( __WEBPACK_AMD_DEFINE_ARRAY__ = [ module , exports , __webpack_require__ ( 54 ) ] , __WEBPACK_AMD_DEFINE_FACTORY__ = ( factory ) ,
7575 __WEBPACK_AMD_DEFINE_RESULT__ = ( typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
7676 ( __WEBPACK_AMD_DEFINE_FACTORY__ . apply ( exports , __WEBPACK_AMD_DEFINE_ARRAY__ ) ) : __WEBPACK_AMD_DEFINE_FACTORY__ ) ,
7777 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && ( module . exports = __WEBPACK_AMD_DEFINE_RESULT__ ) ) ;
@@ -105,13 +105,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
105105
106106/***/ } ) ,
107107
108- /***/ 52 :
108+ /***/ 54 :
109109/***/ ( function ( module , __webpack_exports__ , __webpack_require__ ) {
110110
111111"use strict" ;
112112Object . defineProperty ( __webpack_exports__ , "__esModule" , { value : true } ) ;
113113/*!
114- * better-normal-scroll v1.8.0
114+ * better-normal-scroll v1.8.1
115115 * (c) 2016-2018 ustbhuangyi
116116 * Released under the MIT License.
117117 */
@@ -236,10 +236,11 @@ function eventMixin(BScroll) {
236236 } ;
237237}
238238
239- var ua = navigator . userAgent . toLowerCase ( ) ;
240-
241- var isWeChatDevTools = / w e c h a t d e v t o o l s / . test ( ua ) ;
242- var isAndroid = ua . indexOf ( 'android' ) > 0 ;
239+ // ssr support
240+ var inBrowser = typeof window !== 'undefined' ;
241+ var ua = inBrowser && navigator . userAgent . toLowerCase ( ) ;
242+ var isWeChatDevTools = ua && / w e c h a t d e v t o o l s / . test ( ua ) ;
243+ var isAndroid = ua && ua . indexOf ( 'android' ) > 0 ;
243244
244245function getNow ( ) {
245246 return window . performance && window . performance . now ? window . performance . now ( ) + window . performance . timing . navigationStart : + new Date ( ) ;
@@ -259,9 +260,16 @@ function extend(target) {
259260 return target ;
260261}
261262
262- var elementStyle = document . createElement ( 'div' ) . style ;
263+ function isUndef ( v ) {
264+ return v === undefined || v === null ;
265+ }
266+
267+ var elementStyle = inBrowser && document . createElement ( 'div' ) . style ;
263268
264269var vendor = function ( ) {
270+ if ( ! inBrowser ) {
271+ return false ;
272+ }
265273 var transformNames = {
266274 webkit : 'webkitTransform' ,
267275 Moz : 'MozTransform' ,
@@ -320,11 +328,11 @@ function offset(el) {
320328
321329var transform = prefixStyle ( 'transform' ) ;
322330
323- var hasPerspective = prefixStyle ( 'perspective' ) in elementStyle ;
331+ var hasPerspective = inBrowser && prefixStyle ( 'perspective' ) in elementStyle ;
324332// fix issue #361
325- var hasTouch = 'ontouchstart' in window || isWeChatDevTools ;
333+ var hasTouch = inBrowser && ( 'ontouchstart' in window || isWeChatDevTools ) ;
326334var hasTransform = transform !== false ;
327- var hasTransition = prefixStyle ( 'transition' ) in elementStyle ;
335+ var hasTransition = inBrowser && prefixStyle ( 'transition' ) in elementStyle ;
328336
329337var style = {
330338 transform : transform ,
@@ -924,7 +932,13 @@ function momentum(current, start, time, lowerMargin, wrapperSize, options) {
924932
925933var DEFAULT_INTERVAL = 100 / 60 ;
926934
935+ function noop ( ) { }
936+
927937var requestAnimationFrame = function ( ) {
938+ if ( ! inBrowser ) {
939+ /* istanbul ignore if */
940+ return noop ;
941+ }
928942 return window . requestAnimationFrame || window . webkitRequestAnimationFrame || window . mozRequestAnimationFrame || window . oRequestAnimationFrame ||
929943 // if all else fails, use setTimeout
930944 function ( callback ) {
@@ -933,6 +947,10 @@ var requestAnimationFrame = function () {
933947} ( ) ;
934948
935949var cancelAnimationFrame = function ( ) {
950+ if ( ! inBrowser ) {
951+ /* istanbul ignore if */
952+ return noop ;
953+ }
936954 return window . cancelAnimationFrame || window . webkitCancelAnimationFrame || window . mozCancelAnimationFrame || window . oCancelAnimationFrame || function ( id ) {
937955 window . clearTimeout ( id ) ;
938956 } ;
@@ -943,6 +961,16 @@ var DIRECTION_DOWN = -1;
943961var DIRECTION_LEFT = 1 ;
944962var DIRECTION_RIGHT = - 1 ;
945963
964+ function warn ( msg ) {
965+ console . error ( '[BScroll warn]: ' + msg ) ;
966+ }
967+
968+ function assert ( condition , msg ) {
969+ if ( ! condition ) {
970+ throw new Error ( '[BScroll] ' + msg ) ;
971+ }
972+ }
973+
946974function coreMixin ( BScroll ) {
947975 BScroll . prototype . _start = function ( e ) {
948976 var _eventType = eventType [ e . type ] ;
@@ -1335,6 +1363,7 @@ function coreMixin(BScroll) {
13351363 } ;
13361364
13371365 BScroll . prototype . _translate = function ( x , y ) {
1366+ assert ( ! isUndef ( x ) && ! isUndef ( y ) , 'Oops! translate x or y is null or undefined. please check your code.' ) ;
13381367 if ( this . options . useTransform ) {
13391368 this . scrollerStyle [ style . transform ] = 'translate(' + x + 'px,' + y + 'px)' + this . translateZ ;
13401369 } else {
@@ -1884,10 +1913,6 @@ function snapMixin(BScroll) {
18841913 } ;
18851914}
18861915
1887- function warn ( msg ) {
1888- console . error ( "[BScroll warn]: " + msg ) ;
1889- }
1890-
18911916function wheelMixin ( BScroll ) {
18921917 BScroll . prototype . wheelTo = function ( ) {
18931918 var index = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : 0 ;
@@ -2556,7 +2581,7 @@ pullDownMixin(BScroll);
25562581pullUpMixin ( BScroll ) ;
25572582mouseWheelMixin ( BScroll ) ;
25582583
2559- BScroll . Version = '1.8.0 ' ;
2584+ BScroll . Version = '1.8.1 ' ;
25602585
25612586/* harmony default export */ __webpack_exports__ [ "default" ] = ( BScroll ) ;
25622587
0 commit comments