Updated js part after html refactoring.

This commit is contained in:
Alex Tselegidis 2015-07-25 11:47:46 +02:00
parent 30fe0c9c1d
commit d70db22269
2 changed files with 20 additions and 21 deletions

View file

@ -46,9 +46,8 @@
<div id="calendar-actions">
<div class="btn-group">
<?php //if ($privileges[PRIV_USERS]['edit'] == TRUE) { ?>
<?php if (($role_slug == DB_SLUG_ADMIN || $role_slug == DB_SLUG_PROVIDER)
&& $this->config->item('ea_google_sync_feature') == TRUE) { ?>
&& Config::GOOGLE_SYNC_FEATURE == TRUE) { ?>
<button id="google-sync" class="btn btn-primary"
title="<?php echo $this->lang->line('trigger_google_sync_hint'); ?>">
<span class="glyphicon glyphicon-refresh"></span>

View file

@ -268,13 +268,13 @@ var BackendCalendar = {
// style changes.
if ($('#select-filter-item option:selected').attr('google-sync') === 'true') {
$('#enable-sync').addClass('btn-success enabled');
$('#enable-sync i').addClass('icon-white');
$('#enable-sync span').text(EALang['disable_sync']);
$('#enable-sync span:eq(1)').addClass('icon-white');
$('#enable-sync span:eq(2)').text(EALang['disable_sync']);
$('#google-sync').prop('disabled', false);
} else {
$('#enable-sync').removeClass('btn-success enabled');
$('#enable-sync i').removeClass('icon-white');
$('#enable-sync span').text(EALang['enable_sync']);
$('#enable-sync span:eq(1)').removeClass('icon-white');
$('#enable-sync span:eq(2)').text(EALang['enable_sync']);
$('#google-sync').prop('disabled', true);
}
}
@ -715,8 +715,8 @@ var BackendCalendar = {
windowHandle.close();
window.clearInterval(authInterval);
$('#enable-sync').addClass('btn-success enabled');
$('#enable-sync i').addClass('icon-white');
$('#enable-sync span').text(EALang['disable_sync']);
$('#enable-sync span:eq(1)').addClass('icon-white');
$('#enable-sync span:eq(2)').text(EALang['disable_sync']);
$('#google-sync').prop('disabled', false);
$('#select-filter-item option:selected').attr('google-sync', 'true');
@ -760,8 +760,8 @@ var BackendCalendar = {
BackendCalendar.disableProviderSync(provider['id']);
$('#enable-sync').removeClass('btn-success enabled');
$('#enable-sync i').removeClass('icon-white');
$('#enable-sync span').text(EALang['enable_sync']);
$('#enable-sync span:eq(1)').removeClass('icon-white');
$('#enable-sync span:eq(2)').text(EALang['enable_sync']);
$('#google-sync').prop('disabled', true);
$('#select-filter-item option:selected').attr('google-sync', 'false');