Move the call to action button of modals to the right

This commit is contained in:
Alex Tselegidis 2020-09-07 11:15:01 +03:00
parent 5031b66bd2
commit 769668c828
11 changed files with 55 additions and 60 deletions

View file

@ -329,9 +329,9 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button id="save-appointment" class="btn btn-primary"><?= lang('save') ?></button>
<button id="cancel-appointment" class="btn btn-light" <button id="cancel-appointment" class="btn btn-light"
data-dismiss="modal"><?= lang('cancel') ?></button> data-dismiss="modal"><?= lang('cancel') ?></button>
<button id="save-appointment" class="btn btn-primary"><?= lang('save') ?></button>
</div> </div>
</div> </div>
</div> </div>
@ -395,9 +395,9 @@
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button id="save-unavailable" class="btn btn-primary"><?= lang('save') ?></button>
<button id="cancel-unavailable" class="btn btn-light" <button id="cancel-unavailable" class="btn btn-light"
data-dismiss="modal"><?= lang('cancel') ?></button> data-dismiss="modal"><?= lang('cancel') ?></button>
<button id="save-unavailable" class="btn btn-primary"><?= lang('save') ?></button>
</div> </div>
</div> </div>
</div> </div>
@ -456,8 +456,8 @@
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button id="save-extra" class="btn btn-primary"><?= lang('save') ?></button>
<button id="cancel-extra" class="btn btn-light" data-dismiss="modal"><?= lang('cancel') ?></button> <button id="cancel-extra" class="btn btn-light" data-dismiss="modal"><?= lang('cancel') ?></button>
<button id="save-extra" class="btn btn-primary"><?= lang('save') ?></button>
</div> </div>
</div> </div>
</div> </div>
@ -480,8 +480,8 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button id="select-calendar" class="btn btn-primary"><?= lang('select') ?></button>
<button id="close-calendar" class="btn btn-light" data-dismiss="modal"><?= lang('close') ?></button> <button id="close-calendar" class="btn btn-light" data-dismiss="modal"><?= lang('close') ?></button>
<button id="select-calendar" class="btn btn-primary"><?= lang('select') ?></button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -161,6 +161,12 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
} }
else if (lastFocusedEventData.data.is_unavailable === '0') { else if (lastFocusedEventData.data.is_unavailable === '0') {
var buttons = [ var buttons = [
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
},
{ {
text: 'OK', text: 'OK',
click: function () { click: function () {
@ -181,12 +187,6 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
}) })
.fail(GeneralFunctions.ajaxFailureHandler); .fail(GeneralFunctions.ajaxFailureHandler);
} }
},
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
} }
]; ];
@ -197,7 +197,7 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
$('<textarea/>', { $('<textarea/>', {
'class': 'form-control w-100', 'class': 'form-control w-100',
'id': 'delete-reason', 'id': 'delete-reason',
'rows': '3', 'rows': '3'
}) })
.appendTo('#message-box'); .appendTo('#message-box');
} else { } else {

View file

@ -84,9 +84,6 @@ window.BackendCalendarExtraPeriodsModal = window.BackendCalendarExtraPeriodsModa
}; };
var errorCallback = function (jqXHR, textStatus, errorThrown) { var errorCallback = function (jqXHR, textStatus, errorThrown) {
GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' +
'the operation could not complete due to server communication errors.');
$dialog.find('.modal-message').text(EALang.service_communication_error); $dialog.find('.modal-message').text(EALang.service_communication_error);
$dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden'); $dialog.find('.modal-message').addClass('alert-danger').removeClass('hidden');
}; };

View file

@ -238,6 +238,12 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
.fail(GeneralFunctions.ajaxFailureHandler); .fail(GeneralFunctions.ajaxFailureHandler);
} else if (lastFocusedEventData.data.is_unavailable === '0') { } else if (lastFocusedEventData.data.is_unavailable === '0') {
var buttons = [ var buttons = [
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
},
{ {
text: 'OK', text: 'OK',
click: function () { click: function () {
@ -258,12 +264,6 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
}) })
.fail(GeneralFunctions.ajaxFailureHandler); .fail(GeneralFunctions.ajaxFailureHandler);
} }
},
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
} }
]; ];

View file

@ -106,6 +106,12 @@
var categoryId = $('#category-id').val(); var categoryId = $('#category-id').val();
var buttons = [ var buttons = [
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
},
{ {
text: EALang.delete, text: EALang.delete,
click: function () { click: function () {
@ -113,12 +119,6 @@
$('#message-box').dialog('close'); $('#message-box').dialog('close');
} }
}, },
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
}
]; ];
GeneralFunctions.displayMessageBox(EALang.delete_category, GeneralFunctions.displayMessageBox(EALang.delete_category,

View file

@ -170,15 +170,15 @@
var customerId = $('#customer-id').val(); var customerId = $('#customer-id').val();
var buttons = [ var buttons = [
{ {
text: EALang.delete, text: EALang.cancel,
click: function () { click: function () {
instance.delete(customerId);
$('#message-box').dialog('close'); $('#message-box').dialog('close');
} }
}, },
{ {
text: EALang.cancel, text: EALang.delete,
click: function () { click: function () {
instance.delete(customerId);
$('#message-box').dialog('close'); $('#message-box').dialog('close');
} }
} }

View file

@ -169,15 +169,15 @@
var serviceId = $('#service-id').val(); var serviceId = $('#service-id').val();
var buttons = [ var buttons = [
{ {
text: EALang.delete, text: EALang.cancel,
click: function () { click: function () {
instance.delete(serviceId);
$('#message-box').dialog('close'); $('#message-box').dialog('close');
} }
}, },
{ {
text: EALang.cancel, text: EALang.delete,
click: function () { click: function () {
instance.delete(serviceId);
$('#message-box').dialog('close'); $('#message-box').dialog('close');
} }
} }

View file

@ -243,6 +243,12 @@ window.BackendSettings = window.BackendSettings || {};
*/ */
$('#apply-global-working-plan').on('click', function() { $('#apply-global-working-plan').on('click', function() {
var buttons = [ var buttons = [
{
text: EALang.cancel,
click: function() {
$('#message-box').dialog('close');
}
},
{ {
text: 'OK', text: 'OK',
click: function() { click: function() {
@ -262,12 +268,6 @@ window.BackendSettings = window.BackendSettings || {};
$('#message-box').dialog('close'); $('#message-box').dialog('close');
}); });
} }
},
{
text: EALang.cancel,
click: function() {
$('#message-box').dialog('close');
}
} }
]; ];

View file

@ -110,23 +110,22 @@
var adminId = $('#admin-id').val(); var adminId = $('#admin-id').val();
var buttons = [ var buttons = [
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
},
{ {
text: EALang.delete, text: EALang.delete,
click: function () { click: function () {
this.delete(adminId); this.delete(adminId);
$('#message-box').dialog('close'); $('#message-box').dialog('close');
}.bind(this) }.bind(this)
},
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
} }
]; ];
GeneralFunctions.displayMessageBox(EALang.delete_admin, GeneralFunctions.displayMessageBox(EALang.delete_admin, EALang.delete_record_prompt, buttons);
EALang.delete_record_prompt, buttons);
}.bind(this)); }.bind(this));
/** /**

View file

@ -121,23 +121,22 @@
var providerId = $('#provider-id').val(); var providerId = $('#provider-id').val();
var buttons = [ var buttons = [
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
},
{ {
text: EALang.delete, text: EALang.delete,
click: function () { click: function () {
this.delete(providerId); this.delete(providerId);
$('#message-box').dialog('close'); $('#message-box').dialog('close');
}.bind(this) }.bind(this)
},
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
} }
]; ];
GeneralFunctions.displayMessageBox(EALang.delete_provider, GeneralFunctions.displayMessageBox(EALang.delete_provider, EALang.delete_record_prompt, buttons);
EALang.delete_record_prompt, buttons);
}.bind(this)); }.bind(this));
/** /**

View file

@ -115,18 +115,18 @@
$('#secretaries').on('click', '#delete-secretary', function () { $('#secretaries').on('click', '#delete-secretary', function () {
var secretaryId = $('#secretary-id').val(); var secretaryId = $('#secretary-id').val();
var buttons = [ var buttons = [
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
},
{ {
text: EALang.delete, text: EALang.delete,
click: function () { click: function () {
this.delete(secretaryId); this.delete(secretaryId);
$('#message-box').dialog('close'); $('#message-box').dialog('close');
}.bind(this) }.bind(this)
},
{
text: EALang.cancel,
click: function () {
$('#message-box').dialog('close');
}
} }
]; ];