make sure it's the right direction that is firing the event (#62)

This commit is contained in:
Athou
2013-05-06 12:09:47 +02:00
parent 4aeb0e56ee
commit 0983920403
2 changed files with 4 additions and 3 deletions

View File

@@ -99,11 +99,11 @@ module.directive('onScrollMiddle', function () {
w.data.scrollInit = true;
}
scope.$watch(down, function(value, oldValue) {
if(w.data.scrollDirection == 'down' && value && oldValue && value != oldValue)
if(w.data.scrollDirection == 'down' && value && oldValue && value != oldValue && value == 'above')
scope.$eval(attrs.onScrollMiddle);
});
scope.$watch(up, function(value, oldValue) {
if(w.data.scrollDirection == 'up' && value && oldValue && value != oldValue)
if(w.data.scrollDirection == 'up' && value && oldValue && value != oldValue && value == 'below')
scope.$eval(attrs.onScrollMiddle);
});
}