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);
});
}

View File

@@ -6,7 +6,8 @@
<div infinite-scroll="loadMoreEntries()" infinite-scroll-disabled="busy || !settingsService.settings.readingMode" infinite-scroll-distance="1" id="feed-accordion"
ng-class="{'expanded' : settingsService.settings.viewMode == 'expanded' }">
<div ng-show="message && errorCount > 10">Error while loading this feed : {{message}}</div>
<div ng-repeat="entry in entries" class="entry" scroll-to="isOpen && current == entry" scroll-to-offset="-58" on-scroll-middle="onScroll(entry)" ng-class="{current: current==entry}">
<div ng-repeat="entry in entries" class="entry" scroll-to="isOpen && current == entry" scroll-to-offset="-58" on-scroll-middle="onScroll(entry)"
ng-class="{current: current==entry}">
<a href="{{entry.url}}" target="_blank" class="entry-heading" ng-click="noop($event)" ng-mouseup="entryClicked(entry, $event)"
ng-class="{open: current == entry, closed: current != entry}">
<span class="feed-name">