only add relative path if not starts with http(s)

v1.18.x
Barış Soner Uşaklı 7 years ago
parent 5ed6b5c414
commit f7ccabc3cc

@ -93,7 +93,8 @@ define('forum/account/header', [
paramValue: ajaxify.data.theirid, paramValue: ajaxify.data.theirid,
accept: '.png,.jpg,.bmp', accept: '.png,.jpg,.bmp',
}, function (imageUrlOnServer) { }, function (imageUrlOnServer) {
components.get('account/cover').css('background-image', 'url(' + config.relative_path + imageUrlOnServer + '?' + config['cache-buster'] + ')'); imageUrlOnServer = (!imageUrlOnServer.startsWith('http') ? config.relative_path : '') + imageUrlOnServer + '?' + Date.now();
components.get('account/cover').css('background-image', 'url(' + imageUrlOnServer + ')');
}); });
}, },
removeCover removeCover

Loading…
Cancel
Save