dev: make clients reload css style automatically when source is updated + watched + rebuilded

This commit is contained in:
jean-emmanuel 2016-11-29 22:30:49 +01:00
parent c7e7982d5d
commit 6528fd076d
4 changed files with 19 additions and 1 deletions

View file

@ -145,6 +145,16 @@ module.exports = {
PXSCALE = data.match(/--pixel-scale\s*:\s*([^;]*)/)[1]
INITIALZOOM = PXSCALE
}
},
reloadCss: function(){
var queryString = '?reload=' + new Date().getTime();
$('link[rel="stylesheet"]').each(function () {
this.href = this.href.replace(/\?.*|$/, queryString);
});
setTimeout(()=>{
$('canvas').trigger('resize')
},100)
}
}