Skip to content

Commit ed34323

Browse files
committed
Fixed changes failure
1 parent 345abfc commit ed34323

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

public/app/settings/controller/controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ app.controller('settingsCtrl', ['$scope', 'Settings', '$mdToast', '$mdDialog', '
2222

2323
$scope.newSetting.$save().then(function (success) {
2424

25+
if(success.active){
26+
$rootScope.settings = success;
27+
};
28+
2529
if (i >= 0) {
2630
$scope.settings[i] = success;
2731
} else {

public/app/settings/controller/routes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
//app.constant('PALETTES', ['red', 'purple', 'deep-purple', 'indigo', 'blue', 'light-blue', 'cyan', 'teal', 'green', 'light-green', 'lime', 'yellow', 'amber', 'orange', 'deep-orange', 'brown', 'grey', 'blue-grey']);
22

3-
app.constant('PALETTES', ['red', 'blue', 'blue-grey']);
3+
app.constant('PALETTES', ['red', 'blue', 'blue-grey', 'lime']);
44

55
app.config(['$stateProvider', '$mdThemingProvider', 'PALETTES', function ($stateProvider, $mdThemingProvider, PALETTES) {
66

77
PALETTES.forEach(function (primary, i) {
88
PALETTES.forEach(function (accent, j) {
99
if (i !== j) {
10-
$mdThemingProvider.theme(primary + '_' +accent)
10+
$mdThemingProvider.theme(primary + '_' + accent)
1111
.primaryPalette(primary)
1212
.accentPalette(accent);
1313
}
1414
});
1515
});
1616

17+
$mdThemingProvider.alwaysWatchTheme(true);
1718

1819
$stateProvider
1920
.state('dashboard.settings', {

resources/settings/post.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
if(this.active){
2+
var id = this.id;
23
dpd.settings.get().then(function(settings){
34
settings.forEach(function(setting){
4-
if(setting.active && setting.id !==this.id){
5+
if(setting.active && setting.id !== id){
56
cancel();
67
}
78
});

resources/settings/put.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
if(this.active){
2+
var id = this.id;
23
dpd.settings.get().then(function(settings){
34
settings.forEach(function(setting){
4-
if(setting.active && setting.id !==this.id){
5+
if(setting.active && setting.id !== id){
56
cancel();
67
}
78
});

0 commit comments

Comments
 (0)