js: Don't add scheme and location when reloading CSS

It's not necessary and may (has) lead to the following case:
`http://localhost/http://localhost/icingaweb2/css/icinga.min.css`
This commit is contained in:
Johannes Meyer 2021-06-18 17:19:18 +02:00
parent f8b122b894
commit c01e0f9dc8
1 changed files with 1 additions and 4 deletions

View File

@ -110,12 +110,9 @@
$('link').each(function() {
var $oldLink = $(this);
if ($oldLink.hasAttr('type') && $oldLink.attr('type').indexOf('css') > -1) {
var base = location.protocol + '//' + location.host;
var url = $(this).attr('href');
var $newLink = $oldLink.clone().attr(
'href',
base + '/' + url.replace(/^\//, '')
$(this).attr('href')
).on('load', function() {
$oldLink.remove();
});