From c16a06a273c9ff1d38891f152c3738631d99f072 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Wed, 30 Dec 2015 12:43:25 +0100 Subject: [PATCH] JS will now save the captcha setting. --- src/assets/css/backend.css | 6 ++++-- src/assets/js/backend_settings.js | 11 ++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/assets/css/backend.css b/src/assets/css/backend.css index bfffba4c..0439d9d6 100644 --- a/src/assets/css/backend.css +++ b/src/assets/css/backend.css @@ -719,12 +719,14 @@ padding: 4px 7px; } #settings-page #user-notifications, -#settings-page #customer-notifications { +#settings-page #customer-notifications, +#settings-page #require-captcha { outline: none; } #settings-page #user-notifications.active, -#settings-page #customer-notifications.active { +#settings-page #customer-notifications.active, +#settings-page #require-captcha.active { background: #B6DCFF; } diff --git a/src/assets/js/backend_settings.js b/src/assets/js/backend_settings.js index a195c76a..692e54ba 100644 --- a/src/assets/js/backend_settings.js +++ b/src/assets/js/backend_settings.js @@ -58,6 +58,10 @@ var BackendSettings = { if (setting.name == 'customer_notifications' && setting.value == '1') { $('#customer-notifications').addClass('active'); } + + if (setting.name == 'require_captcha' && setting.value == '1') { + $('#require-captcha').addClass('active'); + } }); BackendSettings.wp = new WorkingPlan(); @@ -267,6 +271,11 @@ SystemSettings.prototype.get = function() { }); }); + settings.push({ + 'name': 'require_captcha', + 'value': $('#require-captcha').hasClass('active') === true ? '1' : '0' + }); + // Business Logic Tab settings.push({ 'name': 'company_working_plan', @@ -281,7 +290,7 @@ SystemSettings.prototype.get = function() { settings.push({ 'name': 'customer_notifications', 'value': $('#customer-notifications').hasClass('active') === true ? '1' : '0' - }) + }); return settings; };