Skip to content

Commit 6aaee08

Browse files
committed
bottomVisible demo
1 parent 7510f8d commit 6aaee08

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Bottom visible (Adapter)</title>
6+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.js"></script>
7+
<script src="../../dist/ui-scroll.js"></script>
8+
<script src="bottomVisibleAdapter.js"></script>
9+
<link rel="stylesheet" href="../css/style.css" type="text/css"/>
10+
</head>
11+
<body ng-app="application" ng-controller="mainController">
12+
13+
<div class="cont cont-global">
14+
15+
<a class="back" href="../index.html">browse other examples</a>
16+
17+
<h1 class="page-header page-header-exapmle">Bottom visible (Adapter)</h1>
18+
19+
<div class="description">
20+
The Adapter implements bottomVisible property which is a reference to the item currently in the very bottom visible position.
21+
22+
<div class="code">
23+
<pre>&lt;li ui-scroll="item in datasource" adapter="adapter"&gt;*{{item}<!---->}*&lt;/li&gt;</pre>
24+
</div>
25+
26+
<div class="code">
27+
<pre>bottom visible: {{adapter.bottomVisible}<!---->}</pre>
28+
</div>
29+
</div>
30+
31+
<div class="info">
32+
<div class="info-item"><span class="info-item-label">bottom visible:</span> {{adapter.bottomVisible}}</div>
33+
</div>
34+
35+
<div class="viewport" id="viewport-listScroller" ui-scroll-viewport>
36+
<div class="item" ui-scroll="item in datasource" adapter="adapter">*{{item}}*</div>
37+
</div>
38+
39+
</div>
40+
41+
</body>
42+
</html>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
angular.module('application', ['ui.scroll'])
2+
.controller('mainController', [
3+
'$scope', '$log', '$timeout', function ($scope, console, $timeout) {
4+
5+
$scope.adapter = {};
6+
7+
$scope.datasource = {};
8+
9+
$scope.datasource.get = function (index, count, success) {
10+
$timeout(function () {
11+
var result = [];
12+
for (var i = index; i <= index + count - 1; i++) {
13+
result.push("item #" + i);
14+
}
15+
success(result);
16+
}, 100);
17+
};
18+
19+
}
20+
]);

demo/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,15 @@ <h1 class="page-header">Scroller Examples</h1>
5555
Top visible
5656
</a>
5757
&nbsp; / &nbsp;
58-
<a href="topVisible/topVisible.html">
58+
<a href="topVisible/topVisibleAdapter.html">
5959
Top visible (Adapter)
6060
</a>
6161
</li>
62+
<li>
63+
<a href="bottomVisible/bottomVisibleAdapter.html">
64+
Bottom visible (Adapter)
65+
</a>
66+
</li>
6267
<li>
6368
<a href="reload100/reload100.html">
6469
Reload datasource to specified index

0 commit comments

Comments
 (0)