Vuefy theme stylesheets

This commit is contained in:
Andrei Andreev 2018-09-18 20:32:47 +02:00
parent 6385e1b463
commit 7eec9dcb96
3 changed files with 6 additions and 21 deletions

View File

@ -2759,6 +2759,7 @@
<div id="progress" style="display:none">
<div id="progressbar"><span id="progresspercent" ach-tooltip="Percentage until Infinity">0%</span></div>
</div>
<link v-if="model.player.options.theme" type="text/css" rel="stylesheet" :href="themeCss">
</div>
</body>
<div class="videocontainer">

View File

@ -36,27 +36,6 @@ var Theme = function Theme(name, colors) {
Chart.defaults.global.defaultFontColor = colors.chartFont;
normalDimChart.data.datasets[0].borderColor = colors.chartBorder;
stripThemeCss();
if (!this.isDefault())
attachThemeCss();
function stripThemeCss() {
document.querySelectorAll("link").forEach( function(e) {
if (e.href.includes("theme")) e.remove();
});
}
function attachThemeCss() {
let head = document.head;
let link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = "stylesheets/theme-" + name + ".css";
head.appendChild(link);
}
}
};

View File

@ -43,6 +43,11 @@ ui = new Vue({
}
}
}
},
computed: {
themeCss: function() {
return "stylesheets/theme-"+ this.model.player.options.theme +".css";
}
}
});