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