mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
rename website/client to website/client-old
This commit is contained in:
19
website/client-old/js/directives/when-scrolled.directive.js
Normal file
19
website/client-old/js/directives/when-scrolled.directive.js
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
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);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
}());
|
||||
Reference in New Issue
Block a user