1
1
/*!
2
2
* angular-ui-scroll
3
3
* https://github.com/angular-ui/ui-scroll.git
4
- * Version: 1.4.1 -- 2016-04-18T20:39:03.966Z
4
+ * Version: 1.4.1 -- 2016-04-18T22:35:24.296Z
5
5
* License: MIT
6
6
*/
7
7
@@ -226,38 +226,6 @@ module.exports = exports['default'];
226
226
} , { } ] , 3 :[ function ( require , module , exports ) {
227
227
'use strict' ;
228
228
229
- exports . __esModule = true ;
230
- exports [ 'default' ] = Cache ;
231
-
232
- function Cache ( ) {
233
- var cache = Object . create ( Array . prototype ) ;
234
-
235
- angular . extend ( cache , {
236
- add : function add ( item ) {
237
- for ( var i = cache . length - 1 ; i >= 0 ; i -- ) {
238
- if ( cache [ i ] . index === item . scope . $index ) {
239
- cache [ i ] . height = item . element . outerHeight ( ) ;
240
- return ;
241
- }
242
- }
243
- cache . push ( {
244
- index : item . scope . $index ,
245
- height : item . element . outerHeight ( )
246
- } ) ;
247
- } ,
248
- clear : function clear ( ) {
249
- cache . length = 0 ;
250
- }
251
- } ) ;
252
-
253
- return cache ;
254
- }
255
-
256
- module . exports = exports [ 'default' ] ;
257
-
258
- } , { } ] , 4 :[ function ( require , module , exports ) {
259
- 'use strict' ;
260
-
261
229
exports . __esModule = true ;
262
230
263
231
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( 'Cannot call a class as a function' ) ; } }
@@ -342,6 +310,59 @@ var ElementRoutines = (function () {
342
310
exports [ 'default' ] = ElementRoutines ;
343
311
module . exports = exports [ 'default' ] ;
344
312
313
+ } , { } ] , 4 :[ function ( require , module , exports ) {
314
+ 'use strict' ;
315
+
316
+ exports . __esModule = true ;
317
+ exports [ 'default' ] = Padding ;
318
+ function Cache ( ) {
319
+ var cache = Object . create ( Array . prototype ) ;
320
+
321
+ angular . extend ( cache , {
322
+ add : function add ( item ) {
323
+ for ( var i = cache . length - 1 ; i >= 0 ; i -- ) {
324
+ if ( cache [ i ] . index === item . scope . $index ) {
325
+ cache [ i ] . height = item . element . outerHeight ( ) ;
326
+ return ;
327
+ }
328
+ }
329
+ cache . push ( {
330
+ index : item . scope . $index ,
331
+ height : item . element . outerHeight ( )
332
+ } ) ;
333
+ } ,
334
+ clear : function clear ( ) {
335
+ cache . length = 0 ;
336
+ }
337
+ } ) ;
338
+
339
+ return cache ;
340
+ }
341
+
342
+ function Padding ( template ) {
343
+ var result = undefined ;
344
+
345
+ switch ( template . tagName ) {
346
+ case 'dl' :
347
+ throw new Error ( 'ui-scroll directive does not support <' + template . tagName + '> as a repeating tag: ' + template . outerHTML ) ;
348
+ case 'tr' :
349
+ var table = angular . element ( '<table><tr><td><div></div></td></tr></table>' ) ;
350
+ result = table . find ( 'tr' ) ;
351
+ break ;
352
+ case 'li' :
353
+ result = angular . element ( '<li></li>' ) ;
354
+ break ;
355
+ default :
356
+ result = angular . element ( '<div></div>' ) ;
357
+ }
358
+
359
+ result . cache = new Cache ( ) ;
360
+
361
+ return result ;
362
+ }
363
+
364
+ module . exports = exports [ 'default' ] ;
365
+
345
366
} , { } ] , 5 :[ function ( require , module , exports ) {
346
367
'use strict' ;
347
368
@@ -350,9 +371,9 @@ exports['default'] = Viewport;
350
371
351
372
function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { 'default' : obj } ; }
352
373
353
- var _cache = require ( './cache ' ) ;
374
+ var _padding = require ( './padding ' ) ;
354
375
355
- var _cache2 = _interopRequireDefault ( _cache ) ;
376
+ var _padding2 = _interopRequireDefault ( _padding ) ;
356
377
357
378
function Viewport ( elementRoutines , buffer , element , controllers , attrs ) {
358
379
var PADDING_MIN = 0.3 ;
@@ -366,36 +387,14 @@ function Viewport(elementRoutines, buffer, element, controllers, attrs) {
366
387
'display' : 'block'
367
388
} ) ;
368
389
369
- function Padding ( template ) {
370
- var result = undefined ;
371
-
372
- switch ( template . tagName ) {
373
- case 'dl' :
374
- throw new Error ( 'ui-scroll directive does not support <' + template . tagName + '> as a repeating tag: ' + template . outerHTML ) ;
375
- case 'tr' :
376
- var table = angular . element ( '<table><tr><td><div></div></td></tr></table>' ) ;
377
- result = table . find ( 'tr' ) ;
378
- break ;
379
- case 'li' :
380
- result = angular . element ( '<li></li>' ) ;
381
- break ;
382
- default :
383
- result = angular . element ( '<div></div>' ) ;
384
- }
385
-
386
- result . cache = new _cache2 [ 'default' ] ( ) ;
387
-
388
- return result ;
389
- }
390
-
391
390
function bufferPadding ( ) {
392
391
return viewport . outerHeight ( ) * Math . max ( PADDING_MIN , + attrs . padding || PADDING_DEFAULT ) ; // some extra space to initiate preload
393
392
}
394
393
395
394
angular . extend ( viewport , {
396
395
createPaddingElements : function createPaddingElements ( template ) {
397
- topPadding = new Padding ( template ) ;
398
- bottomPadding = new Padding ( template ) ;
396
+ topPadding = new _padding2 [ 'default' ] ( template ) ;
397
+ bottomPadding = new _padding2 [ 'default' ] ( template ) ;
399
398
element . before ( topPadding ) ;
400
399
element . after ( bottomPadding ) ;
401
400
} ,
@@ -565,7 +564,7 @@ function Viewport(elementRoutines, buffer, element, controllers, attrs) {
565
564
566
565
module . exports = exports [ 'default' ] ;
567
566
568
- } , { './cache' : 3 } ] , 6 :[ function ( require , module , exports ) {
567
+ } , { './padding' : 4 } ] , 6 :[ function ( require , module , exports ) {
569
568
/*!
570
569
globals: angular, window
571
570
List of used element methods available in JQuery but not in JQuery Lite
@@ -1012,5 +1011,5 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', function () {
1012
1011
}
1013
1012
} ] ) ;
1014
1013
1015
- } , { './modules/adapter.js' :1 , './modules/buffer.js' :2 , './modules/elementRoutines.js' :4 , './modules/viewport.js' :5 } ] } , { } , [ 6 ] ) ;
1014
+ } , { './modules/adapter.js' :1 , './modules/buffer.js' :2 , './modules/elementRoutines.js' :3 , './modules/viewport.js' :5 } ] } , { } , [ 6 ] ) ;
1016
1015
} ( ) ) ;
0 commit comments