♻️ <style> elements for saving background data

This commit is contained in:
Unihedron 2015-08-15 03:36:50 +08:00
parent 3315b636a3
commit 6e4b28e6b6

View file

@ -706,7 +706,9 @@ lichess.storage = {
// themepicker
$('#themepicker_toggle').one('mouseover', function() {
var applyBackground = function(v) {
$('head').append('<style>body.transp::before{background-image:url(' + v + ');}</style>');
var bgData = document.getElementById('bg-data');
bgData ? bgData.innerHTML = 'body.transp::before{background-image:url(' + v + ');}' :
$('head').append('<style id="bg-data">body.transp::before{background-image:url(' + v + ');}</style>');
};
var $themepicker = $('#themepicker');
$.ajax({