Skip to content

Commit 8b5bdf9

Browse files
committed
feature/settings-animations — Facility for users with less granted phones, they can now disable animations.
1 parent fb02880 commit 8b5bdf9

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

app/setting/setting-list.controller.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
.controller('SettingListController', SettingListController);
77

88
function SettingListController($log, $scope, $cordovaToast, defaultCacheName, CacheFactory,
9-
$ionicPopup, throwErr, ImgCache, $timeout) {
9+
$ionicPopup, throwErr, ImgCache, $timeout, $ionicConfig) {
1010

1111
var vm = this;
1212
vm.settings = {
13-
enableCache: true
13+
enableCache: true,
14+
enableAnimations: true
1415
};
1516
vm.clearing = false;
1617
vm.clearCache = clearCache;
@@ -24,6 +25,18 @@
2425
if (newValue === oldValue) return;
2526
$cordovaToast.showShortBottom('Not implemented yet…');
2627
});
28+
$scope.$watch('vm.settings.enableAnimations', function (newValue, oldValue) {
29+
if (newValue === oldValue) return;
30+
newValue === true ? enableAnimations() : disableAnimations();
31+
});
32+
}
33+
34+
function enableAnimations(){
35+
$ionicConfig.views.transition('platform');
36+
}
37+
38+
function disableAnimations(){
39+
$ionicConfig.views.transition('none');
2740
}
2841

2942
function clearCache() {

app/setting/setting-list.jade

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ ion-view.settings(view-title='Settings')
33
ion-list
44
ion-toggle(ng-model='vm.settings.enableCache', toggle-class='toggle-positive')
55
| Enable Cache
6+
ion-toggle(ng-model='vm.settings.enableAnimations', toggle-class='toggle-positive')
7+
| Enable Animations
68
ion-item(ng-click='vm.clearCache()')
79
button.button.button-assertive.button-small.button-block
810
span(ng-if='vm.clearing') Clearing…

0 commit comments

Comments
 (0)