Refactor reloadStylesheets to receive absolute URLs

This is a preparatory step for a following change in which
reloadStylesheets will have to be able to receive absolute URLs.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2017-08-04 14:27:37 +02:00
parent db52e861dd
commit 5999b212d1
1 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ function preview(setting, value) {
var stylesheetsLoaded = 2;
var reloadStylesheets = function(cssFile) {
var queryString = '?reload=' + new Date().getTime();
var url = OC.generateUrl(cssFile) + queryString;
var url = cssFile + queryString;
var old = $('link[href*="' + cssFile.replace("/","\/") + '"]');
var stylesheet = $("<link/>", {
rel: "stylesheet",
@ -62,8 +62,8 @@ function preview(setting, value) {
stylesheet.appendTo("head");
};
reloadStylesheets('/css/core/server.css');
reloadStylesheets('/apps/theming/styles');
reloadStylesheets(OC.generateUrl('/css/core/server.css'));
reloadStylesheets(OC.generateUrl('/apps/theming/styles'));
// Preview images
var timestamp = new Date().getTime();