@@ -542,25 +542,31 @@ angular.module('ui.scroll', [])
542
542
}
543
543
}
544
544
545
- Object . defineProperty ( _datasource , 'minIndex' , {
546
- set : function ( value ) {
547
- this . _minIndex = value ;
548
- onDatasourceMinIndexChanged ( value ) ;
549
- } ,
550
- get : function get ( ) {
551
- return this . _minIndex ;
552
- }
553
- } ) ;
545
+ let minIndexDesc = Object . getOwnPropertyDescriptor ( _datasource , 'minIndex' ) ;
546
+ if ( ! minIndexDesc || ( ! minIndexDesc . set && ! minIndexDesc . get ) ) {
547
+ Object . defineProperty ( _datasource , 'minIndex' , {
548
+ set : function ( value ) {
549
+ this . _minIndex = value ;
550
+ onDatasourceMinIndexChanged ( value ) ;
551
+ } ,
552
+ get : function get ( ) {
553
+ return this . _minIndex ;
554
+ }
555
+ } ) ;
556
+ }
554
557
555
- Object . defineProperty ( _datasource , 'maxIndex' , {
556
- set : function ( value ) {
557
- this . _maxIndex = value ;
558
- onDatasourceMaxIndexChanged ( value ) ;
559
- } ,
560
- get : function get ( ) {
561
- return this . _maxIndex ;
562
- }
563
- } ) ;
558
+ let maxIndexDesc = Object . getOwnPropertyDescriptor ( _datasource , 'maxIndex' ) ;
559
+ if ( ! maxIndexDesc || ( ! maxIndexDesc . set && ! maxIndexDesc . get ) ) {
560
+ Object . defineProperty ( _datasource , 'maxIndex' , {
561
+ set : function ( value ) {
562
+ this . _maxIndex = value ;
563
+ onDatasourceMaxIndexChanged ( value ) ;
564
+ } ,
565
+ get : function get ( ) {
566
+ return this . _maxIndex ;
567
+ }
568
+ } ) ;
569
+ }
564
570
565
571
return _datasource ;
566
572
} ) ( ) ;
0 commit comments