summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorFlorian Orben <florian.orben@gmail.com>2015-10-28 20:04:22 +0100
committerFlorian Orben <florian.orben@gmail.com>2015-10-29 17:26:34 +0100
commitd630567c91d01d5b78be84ac1a5e638e4e72516c (patch)
treee4105db7466236ee3566de713b71ca2eb27308b8 /web
parent3c8fd9942557aee8a1bc06b2b973bb1e3f9519d0 (diff)
downloadchat-d630567c91d01d5b78be84ac1a5e638e4e72516c.tar.gz
chat-d630567c91d01d5b78be84ac1a5e638e4e72516c.tar.bz2
chat-d630567c91d01d5b78be84ac1a5e638e4e72516c.zip
allow code theme to be shareable
Diffstat (limited to 'web')
-rw-r--r--web/react/components/user_settings/custom_theme_chooser.jsx5
-rw-r--r--web/react/components/user_settings/user_settings_appearance.jsx4
2 files changed, 7 insertions, 2 deletions
diff --git a/web/react/components/user_settings/custom_theme_chooser.jsx b/web/react/components/user_settings/custom_theme_chooser.jsx
index 44b3f4544..095e5b622 100644
--- a/web/react/components/user_settings/custom_theme_chooser.jsx
+++ b/web/react/components/user_settings/custom_theme_chooser.jsx
@@ -40,11 +40,12 @@ export default class CustomThemeChooser extends React.Component {
const theme = {type: 'custom'};
let index = 0;
Constants.THEME_ELEMENTS.forEach((element) => {
- if (index < colors.length) {
+ if (index < colors.length - 1) {
theme[element.id] = colors[index];
}
index++;
});
+ theme.codeTheme = colors[colors.length - 1];
this.props.updateTheme(theme);
}
@@ -78,6 +79,8 @@ export default class CustomThemeChooser extends React.Component {
colors += theme[element.id] + ',';
});
+ colors += theme.codeTheme;
+
const pasteBox = (
<div className='col-sm-12'>
<label className='custom-label'>
diff --git a/web/react/components/user_settings/user_settings_appearance.jsx b/web/react/components/user_settings/user_settings_appearance.jsx
index e94894a1d..7b4b54e27 100644
--- a/web/react/components/user_settings/user_settings_appearance.jsx
+++ b/web/react/components/user_settings/user_settings_appearance.jsx
@@ -100,7 +100,9 @@ export default class UserSettingsAppearance extends React.Component {
);
}
updateTheme(theme) {
- theme.codeTheme = this.state.theme.codeTheme;
+ if (!theme.codeTheme) {
+ theme.codeTheme = this.state.theme.codeTheme;
+ }
this.setState({theme});
Utils.applyTheme(theme);
}