implements refresh button

This commit is contained in:
Athou
2013-03-24 17:52:43 +01:00
parent faa475adcc
commit fa18c80e84
2 changed files with 7 additions and 4 deletions

View File

@@ -1,11 +1,11 @@
<div class="toolbar">
<span>Reading Mode </span>
<div class="btn-group" data-toggle="buttons-radio">
<div class="btn-group read-mode" data-toggle="buttons-radio">
<button type="button" class="btn" ng-model="settings.readingMode" btn-radio="'unread'">Unread</button>
<button type="button" class="btn" ng-model="settings.readingMode" btn-radio="'all'">All</button>
</div>
<button type="button" class="btn"><i class="icon icon-refresh"></i> Refresh</button>
<button type="button" class="btn" ng-click="refresh()"><i class="icon icon-refresh"></i> Refresh</button>
<button type="button" class="btn"><i class="icon icon-ok"></i> Mark all as read</button>
</div>

View File

@@ -81,11 +81,14 @@ module.directive('toolbar', function(SettingsService) {
restrict : 'E',
replace : true,
templateUrl : 'directives/toolbar.html',
controller : function($scope, SettingsService) {
controller : function($scope, $route, SettingsService) {
$scope.settings = SettingsService.settings;
$scope.refresh = function() {
$route.reload();
}
},
link : function($scope, element) {
element.find('button').bind('click', function() {
element.find('.read-mode button').bind('click', function() {
SettingsService.save();
});
}