From 522ff67c638512ad92df74fd7faddf1da7c37d6a Mon Sep 17 00:00:00 2001 From: Asaad Mahmood Date: Mon, 15 Feb 2016 19:37:06 +0500 Subject: Multiple UI Improvements --- .../user_settings/custom_theme_chooser.jsx | 108 +++++++++++++++++++-- 1 file changed, 101 insertions(+), 7 deletions(-) (limited to 'web/react/components/user_settings/custom_theme_chooser.jsx') diff --git a/web/react/components/user_settings/custom_theme_chooser.jsx b/web/react/components/user_settings/custom_theme_chooser.jsx index 2d88a3650..242615bc0 100644 --- a/web/react/components/user_settings/custom_theme_chooser.jsx +++ b/web/react/components/user_settings/custom_theme_chooser.jsx @@ -102,6 +102,7 @@ class CustomThemeChooser extends React.Component { this.onPickerChange = this.onPickerChange.bind(this); this.onInputChange = this.onInputChange.bind(this); this.pasteBoxChange = this.pasteBoxChange.bind(this); + this.toggleContent = this.toggleContent.bind(this); this.state = {}; } @@ -153,11 +154,18 @@ class CustomThemeChooser extends React.Component { this.props.updateTheme(theme); } + toggleContent(e) { + e.stopPropagation(); + $(e.target).next().slideToggle(); + $(e.target).toggleClass('open'); + } render() { const {formatMessage} = this.props.intl; const theme = this.props.theme; - const elements = []; + const sidebarElements = []; + const centerChannelElements = []; + const linkAndButtonElements = []; let colors = ''; Constants.THEME_ELEMENTS.forEach((element, index) => { if (element.id === 'codeTheme') { @@ -187,9 +195,9 @@ class CustomThemeChooser extends React.Component { ); - elements.push( + centerChannelElements.push(
@@ -219,10 +227,54 @@ class CustomThemeChooser extends React.Component {
); + } else if (element.group === 'centerChannelElements') { + centerChannelElements.push( +
+ +
+ + +
+
+ ); + } else if (element.group === 'sidebarElements') { + sidebarElements.push( +
+ +
+ + +
+
+ ); + + colors += theme[element.id] + ','; } else { - elements.push( + linkAndButtonElements.push(
@@ -265,9 +317,51 @@ class CustomThemeChooser extends React.Component { ); return ( -
+
+
+
+ {'Sidebar Styles'} +
+ + +
+
+
+ {sidebarElements} +
+
+
+
+ {'Center Channel Styles'} +
+ + +
+
+
+ {centerChannelElements} +
+
- {elements} +
+ {'Link and Button Styles'} +
+ + +
+
+
+ {linkAndButtonElements} +
{pasteBox} -- cgit v1.2.3-1-g7c22