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

pull/1/head
ansuz 2017-01-05 14:14:26 +01:00
parent 5080751a90
commit e56cc49f79
1 changed files with 5 additions and 0 deletions

View File

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