OC.generateUrl('/apps/theming/ajax/updateStylesheet'), {'setting' : setting, 'value' : value}
).done(function(response) {
hideUndoButton(setting, value);
- preview(setting, value);
+ preview(setting, value, response.data.serverCssUrl);
}).fail(function(response) {
OC.msg.finishedSaving('#theming_settings_msg', response);
$('#theming_settings_loading').hide();
}
-function preview(setting, value) {
+function preview(setting, value, serverCssUrl) {
OC.msg.startAction('#theming_settings_msg', t('theming', 'Loading preview…'));
- var stylesheetsLoaded = 2;
+ var stylesheetsLoaded = 1;
var reloadStylesheets = function(cssFile) {
var queryString = '?reload=' + new Date().getTime();
var url = cssFile + queryString;
stylesheet.appendTo("head");
};
- reloadStylesheets(OC.generateUrl('/css/core/server.css'));
+ if (serverCssUrl !== undefined) {
+ stylesheetsLoaded++;
+
+ reloadStylesheets(serverCssUrl);
+ }
reloadStylesheets(OC.generateUrl('/apps/theming/styles'));
// Preview images
var input = document.getElementById('theming-'+setting);
input.value = response.data.value;
}
- preview(setting, response.data.value);
+ preview(setting, response.data.value, response.data.serverCssUrl);
});
});