mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
scroll to entries only when navigating through click or keyboard, not scroll (#62)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user