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,20 +46,19 @@
<div id="calendar-actions"> <div id="calendar-actions">
<div class="btn-group"> <div class="btn-group">
<?php //if ($privileges[PRIV_USERS]['edit'] == TRUE) { ?>
<?php if (($role_slug == DB_SLUG_ADMIN || $role_slug == DB_SLUG_PROVIDER) <?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" <button id="google-sync" class="btn btn-primary"
title="<?php echo $this->lang->line('trigger_google_sync_hint'); ?>"> title="<?php echo $this->lang->line('trigger_google_sync_hint'); ?>">
<span class="glyphicon glyphicon-refresh"></span> <span class="glyphicon glyphicon-refresh"></span>
<?php echo $this->lang->line('synchronize'); ?> <?php echo $this->lang->line('synchronize'); ?>
</button> </button>
<button id="enable-sync" class="btn" data-toggle="button" <button id="enable-sync" class="btn" data-toggle="button"
title="<?php echo $this->lang->line('enable_appointment_sync_hint'); ?>"> title="<?php echo $this->lang->line('enable_appointment_sync_hint'); ?>">
<span class="glyphicon glyphicon-calendar"></span> <span class="glyphicon glyphicon-calendar"></span>
<?php echo $this->lang->line('enable_sync'); ?> <?php echo $this->lang->line('enable_sync'); ?>
</button> </button>
<?php } ?> <?php } ?>
<button id="reload-appointments" class="btn" <button id="reload-appointments" class="btn"

View file

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