-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from angular-ui/paddings
Paddings
- Loading branch information
Showing
12 changed files
with
463 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Reload 100</title> | ||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.js"></script> | ||
<script src="../../dist/ui-scroll.js"></script> | ||
<script src="../../dist/ui-scroll-jqlite.js"></script> | ||
<script src="reload100.js"></script> | ||
<link rel="stylesheet" href="../css/style.css" type="text/css"/> | ||
</head> | ||
<body ng-controller="mainController" ng-app="application"> | ||
|
||
<div class="cont cont-global"> | ||
|
||
<a class="back" href="../index.html">browse other examples</a> | ||
|
||
<h1 class="page-header page-header-exapmle">Reload with parameter</h1> | ||
|
||
<div class="description"> | ||
Here we provide an ability to reload the datasource to some specified position. | ||
</div> | ||
|
||
<div class="actions" ng-init="reloadIndex = 100"> | ||
<input ng-model="reloadIndex" size="2"> - index to reload <br> | ||
<button ng-click="doReload(reloadIndex)"> Reload({{reloadIndex}}) </button> | ||
</div> | ||
|
||
<div ng-if="delay" class="viewport" id="viewport-serviceDatasource" ui-scroll-viewport> | ||
<div class="item" ui-scroll="item in datasource" adapter="adapter">{{item}}</div> | ||
</div> | ||
|
||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) | ||
.controller('mainController', [ | ||
'$scope', '$log', '$timeout', function ($scope, console, $timeout) { | ||
var datasource = {}; | ||
|
||
datasource.get = function (index, count, success) { | ||
$timeout(function () { | ||
var result = []; | ||
for (var i = index; i <= index + count - 1; i++) { | ||
result.push("item #" + i); | ||
} | ||
success(result); | ||
}, 100); | ||
}; | ||
|
||
$scope.datasource = datasource; | ||
$scope.adapter = {}; | ||
|
||
$scope.doReload = function () { | ||
if (angular.isFunction($scope.adapter.reload)) { | ||
var reloadIndex = parseInt($scope.reloadIndex, 10); | ||
reloadIndex = isNaN(reloadIndex) ? 1 : reloadIndex; | ||
$scope.adapter.reload(reloadIndex); | ||
} | ||
}; | ||
|
||
$scope.delay = false; | ||
$timeout(function() { | ||
$scope.delay = true; | ||
}, 500); | ||
|
||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>User min and max indexes</title> | ||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.js"></script> | ||
<script src="../../dist/ui-scroll.js"></script> | ||
<script src="../../dist/ui-scroll-jqlite.js"></script> | ||
<script src="userIndexes.js"></script> | ||
<link rel="stylesheet" href="../css/style.css" type="text/css"/> | ||
<style type="text/css"> | ||
button { | ||
width: 180px; | ||
margin-bottom: 3px; | ||
margin-right: 7px; | ||
} | ||
</style> | ||
</head> | ||
<body ng-controller="mainController" ng-app="application"> | ||
|
||
<div class="cont cont-global"> | ||
|
||
<a class="back" href="../index.html">browse other examples</a> | ||
|
||
<h1 class="page-header page-header-exapmle">Set user min and max indexes</h1> | ||
|
||
<div class="description"> | ||
Here we provide an ability of external min and max indexes setting to let the viewport know how many items do we have. | ||
</div> | ||
|
||
<div class="actions" ng-init="userMinIndex = -100; userMaxIndex = 100"> | ||
<button ng-click="setUserMinIndex()"> Set minIndex = {{userMinIndex}} </button> | ||
<input ng-model="userMinIndex" size="2"> minIndex value to set | ||
<br> | ||
<button ng-click="setUserMaxIndex()"> Set maxIndex = {{userMaxIndex}} </button> | ||
<input ng-model="userMaxIndex" size="2"> maxIndex value to set | ||
<br> | ||
<button ng-click="setUserIndexes()"> Set both Indexes </button> | ||
</div> | ||
|
||
<div ng-if="delay" class="viewport" id="viewport-serviceDatasource" ui-scroll-viewport> | ||
<div class="item" ui-scroll="item in datasource" adapter="adapter">{{item}}</div> | ||
</div> | ||
|
||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
angular.module('application', ['ui.scroll', 'ui.scroll.jqlite']) | ||
.controller('mainController', [ | ||
'$scope', '$log', '$timeout', function ($scope, console, $timeout) { | ||
var datasource = {}; | ||
|
||
datasource.get = function (index, count, success) { | ||
$timeout(function () { | ||
var result = []; | ||
for (var i = index; i <= index + count - 1; i++) { | ||
result.push("item #" + i); | ||
} | ||
success(result); | ||
}, 100); | ||
}; | ||
|
||
$scope.datasource = datasource; | ||
$scope.adapter = {}; | ||
|
||
$scope.setUserMinIndex = function () { | ||
var userMinIndex = parseInt($scope.userMinIndex, 10); | ||
if(!isNaN(userMinIndex)) | ||
$scope.datasource.minIndex = userMinIndex; | ||
}; | ||
|
||
$scope.setUserMaxIndex = function () { | ||
var userMaxIndex = parseInt($scope.userMaxIndex, 10); | ||
if(!isNaN(userMaxIndex)) | ||
$scope.datasource.maxIndex = userMaxIndex; | ||
}; | ||
|
||
$scope.setUserIndexes = function () { | ||
$scope.setUserMinIndex(); | ||
$scope.setUserMaxIndex(); | ||
}; | ||
|
||
$scope.delay = false; | ||
$timeout(function() { | ||
$scope.delay = true; | ||
}, 500); | ||
|
||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.