forked from Archives/Athou_commafeed
toolbar navigation icons
This commit is contained in:
@@ -24,6 +24,8 @@ new_category.parent=Parent
|
|||||||
|
|
||||||
toolbar.unread=Unread
|
toolbar.unread=Unread
|
||||||
toolbar.all=All
|
toolbar.all=All
|
||||||
|
toolbar.previous_entry=Previous entry
|
||||||
|
toolbar.next_entry=Next entry
|
||||||
toolbar.refresh=Refresh
|
toolbar.refresh=Refresh
|
||||||
toolbar.sort_by_asc_desc=Sort by date asc/desc
|
toolbar.sort_by_asc_desc=Sort by date asc/desc
|
||||||
toolbar.mark_all_as_read=Mark all as read
|
toolbar.mark_all_as_read=Mark all as read
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
var module = angular.module('commafeed.controllers', []);
|
var module = angular.module('commafeed.controllers', []);
|
||||||
|
|
||||||
module.run(['$rootScope', function($rootScope) {
|
module.run(['$rootScope', function($rootScope) {
|
||||||
|
$rootScope.$on('emitPreviousEntry', function(event, args) {
|
||||||
|
$rootScope.$broadcast('previousEntry', args);
|
||||||
|
});
|
||||||
|
$rootScope.$on('emitNextEntry', function(event, args) {
|
||||||
|
$rootScope.$broadcast('nextEntry', args);
|
||||||
|
});
|
||||||
$rootScope.$on('emitMark', function(event, args) {
|
$rootScope.$on('emitMark', function(event, args) {
|
||||||
// args.entry - the entry
|
// args.entry - the entry
|
||||||
$rootScope.$broadcast('mark', args);
|
$rootScope.$broadcast('mark', args);
|
||||||
@@ -381,6 +387,15 @@ function($scope, $http, $state, $stateParams, $route, $location,
|
|||||||
$scope.$emit('emitReload');
|
$scope.$emit('emitReload');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.previousEntry = function() {
|
||||||
|
$scope.$emit('emitPreviousEntry');
|
||||||
|
};
|
||||||
|
$scope.nextEntry = function() {
|
||||||
|
$scope.$emit('emitNextEntry');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
$scope.refresh = function() {
|
$scope.refresh = function() {
|
||||||
if($stateParams._type == 'feed'){
|
if($stateParams._type == 'feed'){
|
||||||
FeedService.refresh({
|
FeedService.refresh({
|
||||||
@@ -580,7 +595,7 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
|
|||||||
$scope.isOpen = SettingsService.settings.viewMode == 'expanded';
|
$scope.isOpen = SettingsService.settings.viewMode == 'expanded';
|
||||||
$scope.entryClicked = function(entry, event) {
|
$scope.entryClicked = function(entry, event) {
|
||||||
$scope.navigationMode = 'click';
|
$scope.navigationMode = 'click';
|
||||||
if (!event.ctrlKey && event.which != 2) {
|
if (!event || (!event.ctrlKey && event.which != 2)) {
|
||||||
if ($scope.current != entry || SettingsService.settings.viewMode == 'expanded') {
|
if ($scope.current != entry || SettingsService.settings.viewMode == 'expanded') {
|
||||||
$scope.isOpen = true;
|
$scope.isOpen = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -590,8 +605,10 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
|
|||||||
$scope.mark(entry, true);
|
$scope.mark(entry, true);
|
||||||
}
|
}
|
||||||
$scope.current = entry;
|
$scope.current = entry;
|
||||||
event.preventDefault();
|
if(event) {
|
||||||
event.stopPropagation();
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$scope.mark(entry, true);
|
$scope.mark(entry, true);
|
||||||
}
|
}
|
||||||
@@ -731,6 +748,12 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.$on('previousEntry', function(event, args) {
|
||||||
|
openPreviousEntry();
|
||||||
|
});
|
||||||
|
$scope.$on('nextEntry', function(event, args) {
|
||||||
|
openNextEntry();
|
||||||
|
});
|
||||||
$scope.$on('markAll', function(event, args) {
|
$scope.$on('markAll', function(event, args) {
|
||||||
$scope.markAll(args.olderThan);
|
$scope.markAll(args.olderThan);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,11 @@
|
|||||||
<a type="button" class="btn" ng-model="settingsService.settings.viewMode" btn-radio="'expanded'" title="Expanded view"><i class="icon-th-list"></i></a>
|
<a type="button" class="btn" ng-model="settingsService.settings.viewMode" btn-radio="'expanded'" title="Expanded view"><i class="icon-th-list"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a type="button" class="btn" ng-click="refresh()" title="${toolbar.refresh}"><i class="icon-refresh"></i></a>
|
<div class="btn-group">
|
||||||
|
<a type="button" class="btn" ng-click="previousEntry()" title="${toolbar.previous_entry}"><i class="icon-chevron-up"></i></a>
|
||||||
|
<a type="button" class="btn" ng-click="nextEntry()" title="${toolbar.next_entry}"><i class="icon-chevron-down"></i></a>
|
||||||
|
<a type="button" class="btn" ng-click="refresh()" title="${toolbar.refresh}"><i class="icon-refresh"></i></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a type="button" class="btn" ng-click="markAllAsRead()" title="${toolbar.mark_all_as_read}"><i class="icon-check"></i></a>
|
<a type="button" class="btn" ng-click="markAllAsRead()" title="${toolbar.mark_all_as_read}"><i class="icon-check"></i></a>
|
||||||
|
|||||||
Reference in New Issue
Block a user