1
1
var FxpScroller = ( function ( exports , $$1 ) {
2
2
'use strict' ;
3
3
4
- $$1 = $$1 && $$1 . hasOwnProperty ( 'default' ) ? $$1 [ 'default' ] : $$1 ;
4
+ $$1 = $$1 && Object . prototype . hasOwnProperty . call ( $$1 , 'default' ) ? $$1 [ 'default' ] : $$1 ;
5
5
6
6
function _typeof ( obj ) {
7
+ "@babel/helpers - typeof" ;
8
+
7
9
if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) {
8
10
_typeof = function ( obj ) {
9
11
return typeof obj ;
@@ -70,6 +72,19 @@ var FxpScroller = (function (exports, $$1) {
70
72
return _setPrototypeOf ( o , p ) ;
71
73
}
72
74
75
+ function _isNativeReflectConstruct ( ) {
76
+ if ( typeof Reflect === "undefined" || ! Reflect . construct ) return false ;
77
+ if ( Reflect . construct . sham ) return false ;
78
+ if ( typeof Proxy === "function" ) return true ;
79
+
80
+ try {
81
+ Date . prototype . toString . call ( Reflect . construct ( Date , [ ] , function ( ) { } ) ) ;
82
+ return true ;
83
+ } catch ( e ) {
84
+ return false ;
85
+ }
86
+ }
87
+
73
88
function _assertThisInitialized ( self ) {
74
89
if ( self === void 0 ) {
75
90
throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ;
@@ -86,6 +101,25 @@ var FxpScroller = (function (exports, $$1) {
86
101
return _assertThisInitialized ( self ) ;
87
102
}
88
103
104
+ function _createSuper ( Derived ) {
105
+ var hasNativeReflectConstruct = _isNativeReflectConstruct ( ) ;
106
+
107
+ return function _createSuperInternal ( ) {
108
+ var Super = _getPrototypeOf ( Derived ) ,
109
+ result ;
110
+
111
+ if ( hasNativeReflectConstruct ) {
112
+ var NewTarget = _getPrototypeOf ( this ) . constructor ;
113
+
114
+ result = Reflect . construct ( Super , arguments , NewTarget ) ;
115
+ } else {
116
+ result = Super . apply ( this , arguments ) ;
117
+ }
118
+
119
+ return _possibleConstructorReturn ( this , result ) ;
120
+ } ;
121
+ }
122
+
89
123
function _superPropBase ( object , property ) {
90
124
while ( ! Object . prototype . hasOwnProperty . call ( object , property ) ) {
91
125
object = _getPrototypeOf ( object ) ;
@@ -196,9 +230,7 @@ var FxpScroller = (function (exports, $$1) {
196
230
* Base class for plugin.
197
231
*/
198
232
199
- var BasePlugin =
200
- /*#__PURE__*/
201
- function ( ) {
233
+ var BasePlugin = /*#__PURE__*/ function ( ) {
202
234
/**
203
235
* Constructor.
204
236
*
@@ -236,21 +268,21 @@ var FxpScroller = (function (exports, $$1) {
236
268
237
269
} ] , [ {
238
270
key : "defaultOptions" ,
239
- set : function set ( options ) {
240
- DEFAULT_OPTIONS [ this . name ] = $$1 . extend ( true , { } , DEFAULT_OPTIONS [ this . name ] , options ) ;
241
- }
271
+ get :
242
272
/**
243
273
* Get the default options.
244
274
*
245
275
* @return {object }
246
276
*/
247
- ,
248
- get : function get ( ) {
277
+ function get ( ) {
249
278
if ( undefined === DEFAULT_OPTIONS [ this . name ] ) {
250
279
DEFAULT_OPTIONS [ this . name ] = { } ;
251
280
}
252
281
253
282
return DEFAULT_OPTIONS [ this . name ] ;
283
+ } ,
284
+ set : function set ( options ) {
285
+ DEFAULT_OPTIONS [ this . name ] = $$1 . extend ( true , { } , DEFAULT_OPTIONS [ this . name ] , options ) ;
254
286
}
255
287
} ] ) ;
256
288
@@ -549,11 +581,11 @@ var FxpScroller = (function (exports, $$1) {
549
581
* Scroller class.
550
582
*/
551
583
552
- var Scroller =
553
- /*#__PURE__*/
554
- function ( _BasePlugin ) {
584
+ var Scroller = /*#__PURE__*/ function ( _BasePlugin ) {
555
585
_inherits ( Scroller , _BasePlugin ) ;
556
586
587
+ var _super = _createSuper ( Scroller ) ;
588
+
557
589
/**
558
590
* Constructor.
559
591
*
@@ -567,22 +599,22 @@ var FxpScroller = (function (exports, $$1) {
567
599
568
600
_classCallCheck ( this , Scroller ) ;
569
601
570
- _this = _possibleConstructorReturn ( this , _getPrototypeOf ( Scroller ) . call ( this , element , options ) ) ;
602
+ _this = _super . call ( this , element , options ) ;
571
603
_this . nativeScrollbarSize = getNativeScrollWidth ( ) ;
572
- validateOptions ( _assertThisInitialized ( _assertThisInitialized ( _this ) ) , _this . options ) ;
604
+ validateOptions ( _assertThisInitialized ( _this ) , _this . options ) ;
573
605
_this . isVertical = _this . options . direction === DIRECTION_VERTICAL ;
574
- _this . $content = wrapContent ( _assertThisInitialized ( _assertThisInitialized ( _this ) ) ) ;
606
+ _this . $content = wrapContent ( _assertThisInitialized ( _this ) ) ;
575
607
576
608
if ( _this . options . preventMouseScroll ) {
577
- _this . $element . on ( 'DOMMouseScroll.fxp.scroller mousewheel.fxp.scroller' , null , _assertThisInitialized ( _assertThisInitialized ( _this ) ) , onPreventMouseScroll ) ;
609
+ _this . $element . on ( 'DOMMouseScroll.fxp.scroller mousewheel.fxp.scroller' , null , _assertThisInitialized ( _this ) , onPreventMouseScroll ) ;
578
610
}
579
611
580
612
if ( _this . options . scrollbar ) {
581
- _this . $scrollbar = generateScrollbar ( _assertThisInitialized ( _assertThisInitialized ( _this ) ) , _this . options . direction ) ;
582
- $$1 ( window ) . on ( 'resize.fxp.scroller-bar' + _this . guid , null , _assertThisInitialized ( _assertThisInitialized ( _this ) ) , _this . resizeScrollbar ) ;
613
+ _this . $scrollbar = generateScrollbar ( _assertThisInitialized ( _this ) , _this . options . direction ) ;
614
+ $$1 ( window ) . on ( 'resize.fxp.scroller-bar' + _this . guid , null , _assertThisInitialized ( _this ) , _this . resizeScrollbar ) ;
583
615
}
584
616
585
- _this . $content . on ( 'scroll.fxp.scroller' , null , _assertThisInitialized ( _assertThisInitialized ( _this ) ) , onScrolling ) ;
617
+ _this . $content . on ( 'scroll.fxp.scroller' , null , _assertThisInitialized ( _this ) , onScrolling ) ;
586
618
587
619
if ( _this . options . scrollerStickyHeader && $$1 . fn . stickyHeader ) {
588
620
_this . stickyHeader = _this . $element . stickyHeader ( _this . options . stickyOptions ) . data ( 'fxp.stickyheader' ) ;
0 commit comments