catch errors that popped up because of a cross-origin iframe

This commit is contained in:
ansuz 2017-01-05 14:14:26 +01:00
parent 5080751a90
commit e56cc49f79

View File

@ -506,12 +506,17 @@ define([
}; };
$(config.ifrw).on('click', removeDropdowns); $(config.ifrw).on('click', removeDropdowns);
$(config.ifrw).on('click', cancelEditTitle); $(config.ifrw).on('click', cancelEditTitle);
try {
if (config.ifrw.$('iframe').length) { if (config.ifrw.$('iframe').length) {
var innerIfrw = config.ifrw.$('iframe').each(function (i, el) { var innerIfrw = config.ifrw.$('iframe').each(function (i, el) {
$(el.contentWindow).on('click', removeDropdowns); $(el.contentWindow).on('click', removeDropdowns);
$(el.contentWindow).on('click', cancelEditTitle); $(el.contentWindow).on('click', cancelEditTitle);
}); });
} }
} catch (e) {
// empty try catch in case this iframe is problematic
}
} }
// Update user list // Update user list