Changed message buttons in order to avoid issues with invalid translations.

This commit is contained in:
alext 2017-06-16 08:51:05 +02:00
parent 32d4cf8bf2
commit fe5341a0af
6 changed files with 96 additions and 61 deletions

View file

@ -107,17 +107,24 @@
$('#delete-category').click(function() { $('#delete-category').click(function() {
var categoryId = $('#category-id').val(); var categoryId = $('#category-id').val();
var messageBtns = {}; var buttons = [
messageBtns[EALang['delete']] = function() { {
text: EALang['delete'],
click: function() {
instance.delete(categoryId); instance.delete(categoryId);
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
messageBtns[EALang['cancel']] = function() { },
{
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
}
];
GeneralFunctions.displayMessageBox(EALang['delete_category'], GeneralFunctions.displayMessageBox(EALang['delete_category'],
EALang['delete_record_prompt'], messageBtns); EALang['delete_record_prompt'], buttons);
}); });
/** /**

View file

@ -168,19 +168,24 @@
*/ */
$('#delete-customer').click(function() { $('#delete-customer').click(function() {
var customerId = $('#customer-id').val(); var customerId = $('#customer-id').val();
var messageBtns = {}; var buttons = [
{
messageBtns[EALang['delete']] = function() { text: EALang['delete'],
click: function() {
instance.delete(customerId); instance.delete(customerId);
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
},
messageBtns[EALang['cancel']] = function() { {
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
}
];
GeneralFunctions.displayMessageBox(EALang['delete_customer'], GeneralFunctions.displayMessageBox(EALang['delete_customer'],
EALang['delete_record_prompt'], messageBtns); EALang['delete_record_prompt'], buttons);
}); });
}; };

View file

@ -162,19 +162,24 @@
*/ */
$('#delete-service').click(function() { $('#delete-service').click(function() {
var serviceId = $('#service-id').val(); var serviceId = $('#service-id').val();
var messageBtns = {}; var buttons = [
{
messageBtns[EALang['delete']] = function() { text: EALang['delete'],
click: function() {
instance.delete(serviceId); instance.delete(serviceId);
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
},
messageBtns[EALang['cancel']] = function() { {
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
}
];
GeneralFunctions.displayMessageBox(EALang['delete_service'], GeneralFunctions.displayMessageBox(EALang['delete_service'],
EALang['delete_record_prompt'], messageBtns); EALang['delete_record_prompt'], buttons);
}); });
}; };

View file

@ -112,19 +112,25 @@
*/ */
$('#admins').on('click', '#delete-admin', function() { $('#admins').on('click', '#delete-admin', function() {
var adminId = $('#admin-id').val(); var adminId = $('#admin-id').val();
var messageBtns = {};
messageBtns[EALang['delete']] = function() { var buttons = [
{
text: EALang['delete'],
click: function() {
this.delete(adminId); this.delete(adminId);
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}.bind(this); }.bind(this)
},
messageBtns[EALang['cancel']] = function() { {
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
}
];
GeneralFunctions.displayMessageBox(EALang['delete_admin'], GeneralFunctions.displayMessageBox(EALang['delete_admin'],
EALang['delete_record_prompt'], messageBtns); EALang['delete_record_prompt'], buttons);
}.bind(this)); }.bind(this));
/** /**

View file

@ -125,17 +125,24 @@
$('#providers').on('click', '#delete-provider', function() { $('#providers').on('click', '#delete-provider', function() {
var providerId = $('#provider-id').val(); var providerId = $('#provider-id').val();
var messageBtns = {}; var buttons = [
messageBtns[EALang['delete']] = function() { {
text: EALang['delete'],
click: function() {
this.delete(providerId); this.delete(providerId);
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}.bind(this); }.bind(this)
messageBtns[EALang['cancel']] = function() { },
{
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
}
];
GeneralFunctions.displayMessageBox(EALang['delete_provider'], GeneralFunctions.displayMessageBox(EALang['delete_provider'],
EALang['delete_record_prompt'], messageBtns); EALang['delete_record_prompt'], buttons);
}.bind(this)); }.bind(this));
/** /**

View file

@ -117,19 +117,24 @@
*/ */
$('#secretaries').on('click', '#delete-secretary', function() { $('#secretaries').on('click', '#delete-secretary', function() {
var secretaryId = $('#secretary-id').val(); var secretaryId = $('#secretary-id').val();
var messageBtns = {}; var buttons = [
{
messageBtns[EALang['delete']] = function() { text: EALang['delete'],
click: function() {
this.delete(secretaryId); this.delete(secretaryId);
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}.bind(this); }.bind(this)
},
messageBtns[EALang['cancel']] = function() { {
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close'); $('#message_box').dialog('close');
}; }
}
];
GeneralFunctions.displayMessageBox(EALang['delete_secretary'], GeneralFunctions.displayMessageBox(EALang['delete_secretary'],
EALang['delete_record_prompt'], messageBtns); EALang['delete_record_prompt'], buttons);
}.bind(this)); }.bind(this));
/** /**