diff --git a/public/js/icinga.js b/public/js/icinga.js index 06c797a29..b52c19afc 100644 --- a/public/js/icinga.js +++ b/public/js/icinga.js @@ -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); diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index a797aab1f..09876e954 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -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();