From 3cfd0a4326f78bf6118c030497708225705a1240 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 29 Mar 2017 15:40:34 +0200 Subject: [PATCH] commit some garbage --- www/common/rewrite-css.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/common/rewrite-css.js b/www/common/rewrite-css.js index 98c81b35c..4f713cd32 100644 --- a/www/common/rewrite-css.js +++ b/www/common/rewrite-css.js @@ -1,10 +1,12 @@ define([ '/api/config', ], function (Config) { - if (!(Config && Config.requireConf && Config.requireConf.urlArgs)) { return; } - + var urlArgs = Config && Config.requireConf && Config.requireConf.urlArgs; + if (!urlArgs) { return; } document.querySelectorAll('link[rel="stylesheet"][data-rewrite-href]').forEach(function (e) { - e.setAttribute('href', e.getAttribute('data-rewrite-href')); + var href = e.getAttribute('data-rewrite-href'); + href += (/\?/.test(href)?'&':'?') + urlArgs; + e.setAttribute('href', href); }); });