Customer portal : Improved user feedback on modal loading crashs

SVN:trunk[4183]
This commit is contained in:
Guillaume Lajarige
2016-06-03 14:50:17 +00:00
parent 281925755d
commit b24c2b8455

View File

@@ -327,7 +327,9 @@
// Display a error message on modal if the content could not be loaded.
// Note : As of now, we can't display a more detailled message based on the response because Bootstrap doesn't pass response data with the loaded event.
$('body').on('loaded.bs.modal', function (oEvent) {
if($(oEvent.target).find('.modal-content').html().replace(/[\n\r\t]+/g, '') === contentLoaderTemplate)
var sModalContent = $(oEvent.target).find('.modal-content').html();
if( (sModalContent === '') || (sModalContent.replace(/[\n\r\t]+/g, '') === contentLoaderTemplate) )
{
$(oEvent.target).find('.modal-content').html($('#modal-for-alert .modal-content').html());
$(oEvent.target).find('.modal-content .modal-header .modal-title').text('{{ 'Error:HTTP:500'|dict_s }}');