Allow IcingaWeb to trigger a browser-side CSS reload
This commit is contained in:
parent
48913767d3
commit
8dbf7b0729
|
@ -304,6 +304,11 @@
|
|||
req.$target.attr('class', 'container'); // TODO: remove module-$name
|
||||
}
|
||||
|
||||
var cssreload = req.getResponseHeader('X-Icinga-CssReload');
|
||||
if (cssreload) {
|
||||
this.icinga.ui.reloadCss();
|
||||
}
|
||||
|
||||
var title = req.getResponseHeader('X-Icinga-Title');
|
||||
if (title && req.$target.closest('.dashboard').length === 0) {
|
||||
this.icinga.ui.setTitle(title);
|
||||
|
|
|
@ -76,6 +76,21 @@
|
|||
return this;
|
||||
},
|
||||
|
||||
reloadCss: function () {
|
||||
var utils = this.icinga.utils;
|
||||
$('link').each(function() {
|
||||
if ($(this).attr('type').indexOf('css') > -1) {
|
||||
$(this).attr(
|
||||
'href',
|
||||
utils.addUrlParams(
|
||||
$(this).attr('href'),
|
||||
[ { name: 'id', value: new Date().getTime() } ]
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
enableTimeCounters: function () {
|
||||
this.timeCounterTimer = this.icinga.timer.register(
|
||||
this.refreshTimeSince,
|
||||
|
|
Loading…
Reference in New Issue