-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathux-iscroll.js
32 lines (31 loc) · 883 Bytes
/
ux-iscroll.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(function () {
'use strict';
function uxIscroll() {
return {
restrict: 'A',
transclude: true,
template: '<div ng-transclude style="min-height: 100vh; display: flex; flex-direction: column;"></div>',
link: function (scope, element) {
element.css({
position: 'relative',
overflow: 'hidden'
});
/* global IScroll */
var scroll = new IScroll(element[0], {
mouseWheel: true,
disableMouse: true,
disablePointer: true,
interactiveScrollbars: true,
scrollbars: true,
fadeScrollbars: true
});
scope.$on('$destroy', function () {
scroll.destroy();
scroll = null;
});
}
};
}
angular.module('angular-iscroll', []);
angular.module('angular-iscroll').directive('uxIscroll', uxIscroll);
})();