Skip to content

Commit

Permalink
Refactor reloadStylesheets to receive absolute URLs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
danxuliu committed Aug 10, 2017
1 parent db52e86 commit 5999b21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/theming/js/settings-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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'));

This comment has been minimized.

Copy link
@croessner

croessner Aug 26, 2017

Is this the correct path? Sorry, if I ask. This app is currently broken for me. See my issue here on Github.

Shouldn't this point to /core/css/server.scss

Again. Sorry if I am wrong

This comment has been minimized.

Copy link
@danxuliu

danxuliu Aug 28, 2017

Author Member

Is this the correct path?

It is the correct path; the .scss one is not a real CSS file, but a source file from which the actual CSS files are generated.

Sorry, if I ask.

No problem at all! You are trying to help, that is great! :-)

This app is currently broken for me. See my issue here on Github.

See my answer ;-)

reloadStylesheets(OC.generateUrl('/apps/theming/styles'));

// Preview images
var timestamp = new Date().getTime();
Expand Down

0 comments on commit 5999b21

Please sign in to comment.