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:
parent
f8b122b894
commit
c01e0f9dc8
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue