load stylesheets in displayPopup (#25572)

This commit is contained in:
Benjamin Dauvergne 2018-08-02 17:34:34 +02:00
parent d8773d60d0
commit 8f3737b003
1 changed files with 10 additions and 0 deletions

View File

@ -137,6 +137,16 @@ var gadjo_js = gadjo_js || {};
success: function () {},
}));
}
/* load additional stylesheets from popup */
var $stylesheet = $html.filter('link[rel="stylesheet"]');
for (var i = 0; i < $stylesheet.length; i++) {
var stylesheet = $stylesheet[i];
var href = stylesheet.attributes.href.value;
if ($('link[rel="stylesheet"][href="' + href + '"]').length) {
continue;
}
$(stylesheet).appendTo($('head'));
}
/* add millisecond timeout to let additional scripts load */
$.when(loading, deferred_timeout(100)).always(function () {
/* get content and form (if different) ouf of html */