Split directives into separate files

This commit is contained in:
Kevin Gisi
2015-06-08 04:13:55 -04:00
parent e0794b1f08
commit 7ef98ff7e2
12 changed files with 319 additions and 198 deletions

View File

@@ -0,0 +1,17 @@
'use strict';
angular
.module('habitrpg')
.directive('whenScrolled', whenScrolled);
function whenScrolled() {
return function(scope, elm, attr) {
var raw = elm[0];
elm.bind('scroll', function() {
if (raw.scrollTop + raw.offsetHeight >= raw.scrollHeight) {
scope.$apply(attr.whenScrolled);
}
});
};
}