diff options
author | Abijeet <abijeetpatro@gmail.com> | 2017-12-03 18:26:54 +0530 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-12-08 10:42:41 +0100 |
commit | 81f34e224c0e28ebc37ecd9bd7ea7e607fb98486 (patch) | |
tree | 9e0be31109674bda8e890e43585228b2bd425865 /apps/theming/js | |
parent | ef2b0969dd022ed900d01a7567c52635773d6509 (diff) | |
download | nextcloud-server-81f34e224c0e28ebc37ecd9bd7ea7e607fb98486.tar.gz nextcloud-server-81f34e224c0e28ebc37ecd9bd7ea7e607fb98486.zip |
Allows adding of hex color to the theme-color
Fixes #7158. Adds a # on the color if missing.
Increased maxlength, added hash:true for jscolor, and adding a # if not present on the change event.
Since the input element now allows a hex code, changed values to hexcode.
In addition, added a function to get RGB array from hex or rgb values. Calling it in both methods and using it to perform comparison.
Also changed the way we were determining whether the jscolor component had loaded.
Changed the control to use data-jscolor rather than defining opts in the class.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
Diffstat (limited to 'apps/theming/js')
-rw-r--r-- | apps/theming/js/settings-admin.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js index 44a799a19b4..7df1bbf1125 100644 --- a/apps/theming/js/settings-admin.js +++ b/apps/theming/js/settings-admin.js @@ -206,7 +206,11 @@ $(document).ready(function () { }); $('#theming-color').change(function (e) { - setThemingValue('color', '#' + $(this).val()); + var color = $(this).val(); + if (color.indexOf('#') !== 0) { + color = '#' + color; + } + setThemingValue('color', color); }); $('.theme-undo').click(function (e) { |