Skip to content

Commit 3dd2a6f

Browse files
committed
[hotfix] change made to add another palette
1 parent ed34323 commit 3dd2a6f

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

public/app/settings/controller/routes.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
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', 'lime']);
3+
app.constant('PALETTES', ['red', 'purple', 'deep-purple', 'indigo']);
44

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

7+
$mdThemingProvider.alwaysWatchTheme(true);
8+
9+
710
PALETTES.forEach(function (primary, i) {
811
PALETTES.forEach(function (accent, j) {
9-
if (i !== j) {
10-
$mdThemingProvider.theme(primary + '_' + accent)
11-
.primaryPalette(primary)
12-
.accentPalette(accent);
13-
}
12+
PALETTES.forEach(function (warn, k) {
13+
if (i !== j || j !== k || i !== k) {
14+
$mdThemingProvider.theme(primary + '_' + accent + '_' + warn)
15+
.primaryPalette(primary)
16+
.accentPalette(accent)
17+
.warnPalette(warn);
18+
}
19+
20+
});
1421
});
1522
});
1623

17-
$mdThemingProvider.alwaysWatchTheme(true);
1824

1925
$stateProvider
2026
.state('dashboard.settings', {

public/app/settings/partials/dashboard.settings.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ <h3>{{setting.name | uppercase}}</h3>
3131
<md-select placeholder="Accent palette" ng-model="newSetting.accent" style="width:100%;">
3232
<md-option ng-repeat="palette in palettes" value="{{palette}}">{{palette | uppercase}}</md-option>
3333
</md-select>
34+
<md-select placeholder="Warn palette" ng-model="newSetting.warn" style="width:100%;">
35+
<md-option ng-repeat="palette in palettes" value="{{palette}}">{{palette | uppercase}}</md-option>
36+
</md-select>
3437
<md-switch ng-model="newSetting.active">Active</md-switch>
3538
<md-button type="submit" class="md-raised md-primary">Submit</md-button>
3639
<md-button type="button" ng-click="reset()" class="md-raised">Reset</md-button>

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<link rel="stylesheet" href="dist/style.min.css">
1010
</head>
1111

12-
<body md-theme="{{settings.primary}}_{{settings.accent}}">
12+
<body md-theme="{{settings.primary}}_{{settings.accent}}_{{settings.warn}}">
1313
<ui-view></ui-view>
1414
<script src="dpd.js"></script>
1515
<script src="dist/script.min.js"></script>

resources/settings/config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
"required": true,
4141
"id": "accent",
4242
"order": 4
43+
},
44+
"warn": {
45+
"name": "warn",
46+
"type": "string",
47+
"typeLabel": "string",
48+
"required": true,
49+
"id": "warn",
50+
"order": 5
4351
}
4452
}
4553
}

0 commit comments

Comments
 (0)