File tree Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ angular .module (' application' , [' ui.scroll' , ' ui.scroll.jqlite' ])
2+ .controller (' mainController' ,
3+ [ ' $scope' , ' $timeout' , ' $log'
4+ ($scope , $timeout , console ) ->
5+
6+ $scope .datasource =
7+ get : (index , count , success ) ->
8+ result = []
9+ for i in [index.. index + count- 1 ]
10+ result .push " item ##{ i} "
11+ success (result)
12+
13+ $scope .updateMinIndex = ->
14+ $scope .datasource .minIndex = - 20
15+
16+ $scope .scroll = ->
17+ console .log angular .element (document .getElementById (' div' )).triggerHandler (' scroll' )
18+ # angular.element(document.getElementById('div')).triggerHandler('scroll')
19+ # angular.element(document.getElementById('div')).triggerHandler('scroll')
20+ # $scope.adapter.test()
21+
22+ document .getElementById (' scroll' ).onclick =
23+ ->
24+ document .getElementById (' div' ).scrollTop += 10
25+ # console.log
26+ $scope .adapter .test ()
27+
28+ # document.getElementById('div').onclick =
29+ # ->
30+ # document.getElementById('div').scrollTop += 10
31+ # console.log
32+ # $scope.adapter.test()
33+ # $scope.$apply()
34+
35+ ])
36+ angular .bootstrap (document , [" application" ])
37+
38+ ###
39+ //# sourceURL=src/customviewport.js
40+ ###
Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 ">
5+ < title > Scroller Demo (multiple lists) </ title >
6+ < script src ="http://coffeescript.org/extras/coffee-script.js "> </ script >
7+ < script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.js "> </ script >
8+ < script src ="../../src/ui-scroll.coffee " type ="text/coffeescript "> </ script >
9+ < script src ="../../src/ui-scroll-jqlite.coffee " type ="text/coffeescript "> </ script >
10+ < script src ="repro.coffee " type ="text/coffeescript "> </ script >
11+ </ head >
12+ < body ng-controller ="mainController ">
13+ < h2 style ="position: fixed; left: 150px; top: 0; "> is loading: {{loading}}; < a href ="../index.html "> browse sample code</ a > </ h2 >
14+ < h2 > The list </ h2 >
15+ < div id ="div " ui-scroll-viewport style ="height:200px ">
16+ < div id ="1 " ui-scroll ="item in datasource " adapter ="adapter " is-loading ="loading " buffer-size ='4 '> *one {{item}}*</ div >
17+ </ div >
18+ < button ng-click ="updateMinIndex() "> update minIndex</ button >
19+ < button id ="scroll "> scroll</ button >
20+
21+ </ body >
22+ </ html >
You can’t perform that action at this time.
0 commit comments