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() {
var categoryId = $('#category-id').val();
var messageBtns = {};
messageBtns[EALang['delete']] = function() {
var buttons = [
{
text: EALang['delete'],
click: function() {
instance.delete(categoryId);
$('#message_box').dialog('close');
};
messageBtns[EALang['cancel']] = function() {
}
},
{
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close');
};
}
}
];
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() {
var customerId = $('#customer-id').val();
var messageBtns = {};
messageBtns[EALang['delete']] = function() {
var buttons = [
{
text: EALang['delete'],
click: function() {
instance.delete(customerId);
$('#message_box').dialog('close');
};
messageBtns[EALang['cancel']] = function() {
}
},
{
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close');
};
}
}
];
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() {
var serviceId = $('#service-id').val();
var messageBtns = {};
messageBtns[EALang['delete']] = function() {
var buttons = [
{
text: EALang['delete'],
click: function() {
instance.delete(serviceId);
$('#message_box').dialog('close');
};
messageBtns[EALang['cancel']] = function() {
}
},
{
text: EALang['cancel'],
click: function() {
$('#message_box').dialog('close');
};
}
}
];
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() {
var adminId = $('#admin-id').val();
var messageBtns = {};
messageBtns[EALang['delete']] = function() {
var buttons = [
{
text: EALang['delete'],
click: function() {
this.delete(adminId);
$('#message_box').dialog('close');
}.bind(this);
messageBtns[EALang['cancel']] = function() {
}.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));
/**

View file

@ -125,17 +125,24 @@
$('#providers').on('click', '#delete-provider', function() {
var providerId = $('#provider-id').val();
var messageBtns = {};
messageBtns[EALang['delete']] = function() {
var buttons = [
{
text: EALang['delete'],
click: function() {
this.delete(providerId);
$('#message_box').dialog('close');
}.bind(this);
messageBtns[EALang['cancel']] = function() {
}.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));
/**

View file

@ -117,19 +117,24 @@
*/
$('#secretaries').on('click', '#delete-secretary', function() {
var secretaryId = $('#secretary-id').val();
var messageBtns = {};
messageBtns[EALang['delete']] = function() {
var buttons = [
{
text: EALang['delete'],
click: function() {
this.delete(secretaryId);
$('#message_box').dialog('close');
}.bind(this);
messageBtns[EALang['cancel']] = function() {
}.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));
/**