Merge pull request #781 from Unihedro/recycling
Recycle <style> elements for saving background data
This commit is contained in:
commit
76f4843705
|
@ -706,7 +706,9 @@ lichess.storage = {
|
||||||
// themepicker
|
// themepicker
|
||||||
$('#themepicker_toggle').one('mouseover', function() {
|
$('#themepicker_toggle').one('mouseover', function() {
|
||||||
var applyBackground = function(v) {
|
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');
|
var $themepicker = $('#themepicker');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
Loading…
Reference in a new issue