mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
js: fix urls for dynamic css/js reloads
This commit is contained in:
parent
96f50c5dfa
commit
28204762ab
@ -217,7 +217,7 @@
|
|||||||
$ = undefined;
|
$ = undefined;
|
||||||
|
|
||||||
oldjQuery.getScript(
|
oldjQuery.getScript(
|
||||||
oldConfig.baseUrl + 'js/icinga.min.js'
|
oldConfig.baseUrl.replace(/\/$/, '') + '/js/icinga.min.js'
|
||||||
).done(function () {
|
).done(function () {
|
||||||
var jQuery = window.jQuery;
|
var jQuery = window.jQuery;
|
||||||
window.icinga = new window.Icinga(oldConfig);
|
window.icinga = new window.Icinga(oldConfig);
|
||||||
|
@ -99,12 +99,18 @@
|
|||||||
$('link').each(function() {
|
$('link').each(function() {
|
||||||
var $oldLink = $(this);
|
var $oldLink = $(this);
|
||||||
if ($oldLink.hasAttr('type') && $oldLink.attr('type').indexOf('css') > -1) {
|
if ($oldLink.hasAttr('type') && $oldLink.attr('type').indexOf('css') > -1) {
|
||||||
var $newLink = $oldLink.clone().attr(
|
var base = location.protocol + '//' + location.host;
|
||||||
'href',
|
if (location.port) {
|
||||||
icinga.utils.addUrlParams(
|
base += location.port;
|
||||||
|
}
|
||||||
|
var url = icinga.utils.addUrlParams(
|
||||||
$(this).attr('href'),
|
$(this).attr('href'),
|
||||||
{ id: new Date().getTime() }
|
{ id: new Date().getTime() }
|
||||||
)
|
);
|
||||||
|
|
||||||
|
var $newLink = $oldLink.clone().attr(
|
||||||
|
'href',
|
||||||
|
base + '/' + url.replace(/^\//, '')
|
||||||
).on('load', function() {
|
).on('load', function() {
|
||||||
icinga.ui.fixControls();
|
icinga.ui.fixControls();
|
||||||
$oldLink.remove();
|
$oldLink.remove();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user