1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix plugin page refresh

This commit is contained in:
Luke Pulverenti 2016-03-18 12:23:55 -04:00
parent 37927a9a1a
commit 35f69d09ea

View file

@ -107,10 +107,12 @@ define([], function () {
return str.split(find).join(replace); return str.split(find).join(replace);
} }
function parseHtml(html) { function parseHtml(html, hasScript) {
if (hasScript) {
html = replaceAll(html, '<!--<script', '<script'); html = replaceAll(html, '<!--<script', '<script');
html = replaceAll(html, '</script>-->', '</script>'); html = replaceAll(html, '</script>-->', '</script>');
}
var wrapper = document.createElement('div'); var wrapper = document.createElement('div');
wrapper.innerHTML = html; wrapper.innerHTML = html;
@ -126,13 +128,15 @@ define([], function () {
return html; return html;
} }
var elem = parseHtml(options.view); var hasScript = options.view.indexOf('<script') != -1;
var elem = parseHtml(options.view, hasScript);
elem.classList.add('page-view'); elem.classList.add('page-view');
elem.setAttribute('data-type', options.type || ''); elem.setAttribute('data-type', options.type || '');
elem.setAttribute('data-url', options.url); elem.setAttribute('data-url', options.url);
return { return {
elem: elem, elem: elem,
hasScript: options.view.indexOf('<script') != -1 hasScript: hasScript
}; };
} }