diff --git a/src/assets/js/backend_categories_helper.js b/src/assets/js/backend_categories_helper.js index 37e22b51..57ac558b 100644 --- a/src/assets/js/backend_categories_helper.js +++ b/src/assets/js/backend_categories_helper.js @@ -107,17 +107,24 @@ $('#delete-category').click(function() { var categoryId = $('#category-id').val(); - var messageBtns = {}; - messageBtns[EALang['delete']] = function() { - instance.delete(categoryId); - $('#message_box').dialog('close'); - }; - messageBtns[EALang['cancel']] = function() { - $('#message_box').dialog('close'); - }; + var buttons = [ + { + text: EALang['delete'], + click: function() { + instance.delete(categoryId); + $('#message_box').dialog('close'); + } + }, + { + text: EALang['cancel'], + click: function() { + $('#message_box').dialog('close'); + } + } + ]; GeneralFunctions.displayMessageBox(EALang['delete_category'], - EALang['delete_record_prompt'], messageBtns); + EALang['delete_record_prompt'], buttons); }); /** diff --git a/src/assets/js/backend_customers_helper.js b/src/assets/js/backend_customers_helper.js index 3543d04d..4d68be50 100644 --- a/src/assets/js/backend_customers_helper.js +++ b/src/assets/js/backend_customers_helper.js @@ -168,19 +168,24 @@ */ $('#delete-customer').click(function() { var customerId = $('#customer-id').val(); - var messageBtns = {}; - - messageBtns[EALang['delete']] = function() { - instance.delete(customerId); - $('#message_box').dialog('close'); - }; - - messageBtns[EALang['cancel']] = function() { - $('#message_box').dialog('close'); - }; + var buttons = [ + { + text: EALang['delete'], + click: function() { + instance.delete(customerId); + $('#message_box').dialog('close'); + } + }, + { + text: EALang['cancel'], + click: function() { + $('#message_box').dialog('close'); + } + } + ]; GeneralFunctions.displayMessageBox(EALang['delete_customer'], - EALang['delete_record_prompt'], messageBtns); + EALang['delete_record_prompt'], buttons); }); }; diff --git a/src/assets/js/backend_services_helper.js b/src/assets/js/backend_services_helper.js index c73539d2..639b02d7 100644 --- a/src/assets/js/backend_services_helper.js +++ b/src/assets/js/backend_services_helper.js @@ -162,19 +162,24 @@ */ $('#delete-service').click(function() { var serviceId = $('#service-id').val(); - var messageBtns = {}; - - messageBtns[EALang['delete']] = function() { - instance.delete(serviceId); - $('#message_box').dialog('close'); - }; - - messageBtns[EALang['cancel']] = function() { - $('#message_box').dialog('close'); - }; + var buttons = [ + { + text: EALang['delete'], + click: function() { + instance.delete(serviceId); + $('#message_box').dialog('close'); + } + }, + { + text: EALang['cancel'], + click: function() { + $('#message_box').dialog('close'); + } + } + ]; GeneralFunctions.displayMessageBox(EALang['delete_service'], - EALang['delete_record_prompt'], messageBtns); + EALang['delete_record_prompt'], buttons); }); }; diff --git a/src/assets/js/backend_users_admins.js b/src/assets/js/backend_users_admins.js index fd582029..fed0f20c 100644 --- a/src/assets/js/backend_users_admins.js +++ b/src/assets/js/backend_users_admins.js @@ -112,19 +112,25 @@ */ $('#admins').on('click', '#delete-admin', function() { var adminId = $('#admin-id').val(); - var messageBtns = {}; - messageBtns[EALang['delete']] = function() { - this.delete(adminId); - $('#message_box').dialog('close'); - }.bind(this); - - messageBtns[EALang['cancel']] = function() { - $('#message_box').dialog('close'); - }; + var buttons = [ + { + text: EALang['delete'], + click: function() { + this.delete(adminId); + $('#message_box').dialog('close'); + }.bind(this) + }, + { + text: EALang['cancel'], + click: function() { + $('#message_box').dialog('close'); + } + } + ]; GeneralFunctions.displayMessageBox(EALang['delete_admin'], - EALang['delete_record_prompt'], messageBtns); + EALang['delete_record_prompt'], buttons); }.bind(this)); /** diff --git a/src/assets/js/backend_users_providers.js b/src/assets/js/backend_users_providers.js index b30834cb..dcdf0868 100644 --- a/src/assets/js/backend_users_providers.js +++ b/src/assets/js/backend_users_providers.js @@ -125,17 +125,24 @@ $('#providers').on('click', '#delete-provider', function() { var providerId = $('#provider-id').val(); - var messageBtns = {}; - messageBtns[EALang['delete']] = function() { - this.delete(providerId); - $('#message_box').dialog('close'); - }.bind(this); - messageBtns[EALang['cancel']] = function() { - $('#message_box').dialog('close'); - }; + var buttons = [ + { + text: EALang['delete'], + click: function() { + this.delete(providerId); + $('#message_box').dialog('close'); + }.bind(this) + }, + { + text: EALang['cancel'], + click: function() { + $('#message_box').dialog('close'); + } + } + ]; GeneralFunctions.displayMessageBox(EALang['delete_provider'], - EALang['delete_record_prompt'], messageBtns); + EALang['delete_record_prompt'], buttons); }.bind(this)); /** diff --git a/src/assets/js/backend_users_secretaries.js b/src/assets/js/backend_users_secretaries.js index c2e4ad66..53a136e7 100644 --- a/src/assets/js/backend_users_secretaries.js +++ b/src/assets/js/backend_users_secretaries.js @@ -117,19 +117,24 @@ */ $('#secretaries').on('click', '#delete-secretary', function() { var secretaryId = $('#secretary-id').val(); - var messageBtns = {}; - - messageBtns[EALang['delete']] = function() { - this.delete(secretaryId); - $('#message_box').dialog('close'); - }.bind(this); - - messageBtns[EALang['cancel']] = function() { - $('#message_box').dialog('close'); - }; + var buttons = [ + { + text: EALang['delete'], + click: function() { + this.delete(secretaryId); + $('#message_box').dialog('close'); + }.bind(this) + }, + { + text: EALang['cancel'], + click: function() { + $('#message_box').dialog('close'); + } + } + ]; GeneralFunctions.displayMessageBox(EALang['delete_secretary'], - EALang['delete_record_prompt'], messageBtns); + EALang['delete_record_prompt'], buttons); }.bind(this)); /**