mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
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() {
|
$('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 base = location.protocol + '//' + location.host;
|
|
||||||
var url = $(this).attr('href');
|
|
||||||
|
|
||||||
var $newLink = $oldLink.clone().attr(
|
var $newLink = $oldLink.clone().attr(
|
||||||
'href',
|
'href',
|
||||||
base + '/' + url.replace(/^\//, '')
|
$(this).attr('href')
|
||||||
).on('load', function() {
|
).on('load', function() {
|
||||||
$oldLink.remove();
|
$oldLink.remove();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user