scroll to entries only when navigating through click or keyboard, not scroll (#62)

This commit is contained in:
Athou
2013-05-06 15:05:17 +02:00
parent f26d107765
commit 5a40db90bc
2 changed files with 4 additions and 2 deletions

View File

@@ -541,6 +541,7 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
$scope.isOpen = SettingsService.settings.viewMode == 'expanded';
$scope.entryClicked = function(entry, event) {
$scope.navigationMode = 'click';
if (!event.ctrlKey && event.which != 2) {
if ($scope.current != entry || SettingsService.settings.viewMode == 'expanded') {
$scope.isOpen = true;
@@ -608,6 +609,7 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
};
$scope.onScroll = function(entry) {
$scope.navigationMode = 'scroll';
if (SettingsService.settings.viewMode == 'expanded') {
$scope.current = entry;
if(SettingsService.settings.scrollMarks) {

View File

@@ -6,8 +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="navigationMode == 'click' && 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">