mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
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
|
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');
|
var title = req.getResponseHeader('X-Icinga-Title');
|
||||||
if (title && req.$target.closest('.dashboard').length === 0) {
|
if (title && req.$target.closest('.dashboard').length === 0) {
|
||||||
this.icinga.ui.setTitle(title);
|
this.icinga.ui.setTitle(title);
|
||||||
|
@ -76,6 +76,21 @@
|
|||||||
return this;
|
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 () {
|
enableTimeCounters: function () {
|
||||||
this.timeCounterTimer = this.icinga.timer.register(
|
this.timeCounterTimer = this.icinga.timer.register(
|
||||||
this.refreshTimeSince,
|
this.refreshTimeSince,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user