From 1812d66bb45d0c708cd1edb8d84de96f987f2657 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 27 Jul 2015 22:29:20 +0200 Subject: [PATCH] Fixed problem with JS manipulation of provider sync state. --- src/application/views/backend/calendar.php | 2 +- src/assets/js/backend_calendar.js | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/application/views/backend/calendar.php b/src/application/views/backend/calendar.php index f7a89d27..d2f8eee1 100644 --- a/src/application/views/backend/calendar.php +++ b/src/application/views/backend/calendar.php @@ -57,7 +57,7 @@ diff --git a/src/assets/js/backend_calendar.js b/src/assets/js/backend_calendar.js index f5c4fbf4..1a71826c 100644 --- a/src/assets/js/backend_calendar.js +++ b/src/assets/js/backend_calendar.js @@ -268,13 +268,11 @@ var BackendCalendar = { // style changes. if ($('#select-filter-item option:selected').attr('google-sync') === 'true') { $('#enable-sync').addClass('btn-success enabled'); - $('#enable-sync span:eq(1)').addClass('icon-white'); - $('#enable-sync span:eq(2)').text(EALang['disable_sync']); + $('#enable-sync span:eq(1)').text(EALang['disable_sync']); $('#google-sync').prop('disabled', false); } else { $('#enable-sync').removeClass('btn-success enabled'); - $('#enable-sync span:eq(1)').removeClass('icon-white'); - $('#enable-sync span:eq(2)').text(EALang['enable_sync']); + $('#enable-sync span:eq(1)').text(EALang['enable_sync']); $('#google-sync').prop('disabled', true); } } @@ -715,8 +713,7 @@ var BackendCalendar = { windowHandle.close(); window.clearInterval(authInterval); $('#enable-sync').addClass('btn-success enabled'); - $('#enable-sync span:eq(1)').addClass('icon-white'); - $('#enable-sync span:eq(2)').text(EALang['disable_sync']); + $('#enable-sync span:eq(1)').text(EALang['disable_sync']); $('#google-sync').prop('disabled', false); $('#select-filter-item option:selected').attr('google-sync', 'true'); @@ -760,8 +757,7 @@ var BackendCalendar = { BackendCalendar.disableProviderSync(provider['id']); $('#enable-sync').removeClass('btn-success enabled'); - $('#enable-sync span:eq(1)').removeClass('icon-white'); - $('#enable-sync span:eq(2)').text(EALang['enable_sync']); + $('#enable-sync span:eq(1)').text(EALang['enable_sync']); $('#google-sync').prop('disabled', true); $('#select-filter-item option:selected').attr('google-sync', 'false');