Skip to content

Commit

Permalink
test(anchorScroll): improve test page
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Feb 13, 2014
1 parent fc8ab4b commit 68ffe8b
Showing 1 changed file with 26 additions and 41 deletions.
67 changes: 26 additions & 41 deletions js/ext/angular/test/anchorScroll.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,39 @@
<body>

<div ng-controller="MyCtrl">
<header-bar title="title" type="bar-positive">
</header-bar>
<content has-header="true">
<a ng-click="scrollTo('foo')">Click me!</a>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>
<p>...</p>

<div id="foo">Here you are.</div>

<header class="bar bar-header bar-positive">
<div class="buttons">
<button class="button button-icon icon ion-clock" ng-click="doScroll()"></button>
</div>
<h1 class="title">Click the Clock to Get Stuck</h1>
</header>

<content class="has-header">

<list>
<item ng-repeat="item in items"
item="item"
id="foo-{{item.id}}"
href="#/item/{{item.id}}">
Item {{ item.id }}
</item>
</list>

</content>
</div>

<script>
function MyCtrl($scope, $location, $ionicScrollDelegate) {
$scope.scrollTo = function(id) {
$location.hash(id);
$scope.items = [];
for (var i=0; i < 100; i++) {
$scope.items.push({id:i});
}

$scope.doScroll = function() {
$location.hash('foo-50');
$ionicScrollDelegate.anchorScroll(true);
}
}
</script>
</body>
</html>
</body>
</html>

0 comments on commit 68ffe8b

Please sign in to comment.