Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 246ae54

Browse files
Robert MesserleThomasBurleson
authored andcommitted
fix(colors): coverts COLOR_PALETTES to colorPalettes
Value is reassigned, so it is not a constant. Closes #8051
1 parent 05b8c1e commit 246ae54

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/colors/colors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* or one that should be observed and dynamically interpolated.
77
*/
88
var STATIC_COLOR_EXPRESSION = /^{((\s|,)*?["'a-zA-Z-]+?\s*?:\s*?('|")[a-zA-Z0-9-.]*('|"))+\s*}$/;
9-
var COLOR_PALETTES = undefined;
9+
var colorPalettes = undefined;
1010

1111
/**
1212
* @ngdoc module
@@ -41,7 +41,7 @@
4141
*
4242
*/
4343
function MdColorsService($mdTheming, $mdColorPalette, $mdUtil, $parse) {
44-
COLOR_PALETTES = COLOR_PALETTES || Object.keys($mdColorPalette);
44+
colorPalettes = colorPalettes || Object.keys($mdColorPalette);
4545

4646
// Publish service instance
4747
return {
@@ -144,12 +144,12 @@
144144
// If the next section is one of the palettes we assume it's a two word palette
145145
// Two word palette can be also written in camelCase, forming camelCase to dash-case
146146

147-
var isTwoWord = parts.length > 1 && COLOR_PALETTES.indexOf(parts[1]) !== -1;
147+
var isTwoWord = parts.length > 1 && colorPalettes.indexOf(parts[1]) !== -1;
148148
var palette = parts[0].replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
149149

150150
if (isTwoWord) palette = parts[0] + '-' + parts.splice(1, 1);
151151

152-
if (COLOR_PALETTES.indexOf(palette) === -1) {
152+
if (colorPalettes.indexOf(palette) === -1) {
153153
// If the palette is not in the palette list it's one of primary/accent/warn/background
154154
var scheme = $mdTheming.THEMES[theme].colors[palette];
155155
if (!scheme) {

0 commit comments

Comments
 (0)