<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Disabling</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="disabled.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">Disabled attribute</h1>
<div class="description">
There is an property "disabled" on the ui-scroll adapter which allows to ignore user scroll/resize events:
<div class="code">
<pre><div ui-scroll="item in datasource" adapter="myAdapter">{{item}<!---->}</div></pre>
</div>
Here we have two-way binding, so just set the property in appropriate time:
<div class="code">
<pre>$scope.myAdapter.disabled = true;</pre>
</div>
Since "disabled" is true no user scroll is being processed by ui-scroll engine.
</div>
<div class="actions" ng-init="needToDisable = false">
User scroll processing is {{myAdapter.disabled ? "disabled" : "enabled"}} now <br/>
<button ng-click="myAdapter.disabled = !myAdapter.disabled"> {{myAdapter.disabled?"Enable":"Disable"}} </button>
</div>
<div class="viewport" id="viewport-serviceDatasource" ui-scroll-viewport>
<div class="item" ui-scroll="item in datasource" adapter="myAdapter" >{{item}}</div>
</div>
</div>
</body>
</html>