make sure that the preview gets updated every time a new image gets uploaded

This commit is contained in:
Bjoern Schiessle 2016-06-22 14:04:54 +02:00 committed by Lukas Reschke
parent 79269427d7
commit 24144b16d0
1 changed files with 3 additions and 2 deletions

View File

@ -40,11 +40,12 @@ function preview(setting, value) {
if (setting === 'logoMime') {
console.log(setting);
var logos = document.getElementsByClassName('logo-icon');
var timestamp = new Date().getTime();
if(value !== '') {
logos[0].style.background = "url('" + OC.generateUrl('/apps/theming/logo') + "')";
logos[0].style.background = "url('" + OC.generateUrl('/apps/theming/logo') + "?v" + timestamp + "')";
logos[0].style.backgroundSize = "62px 34px";
} else {
logos[0].style.background = "url('" + OC.getRootPath() + '/core/img/logo-icon.svg'+"')";
logos[0].style.background = "url('" + OC.getRootPath() + '/core/img/logo-icon.svg?v' + timestamp +"')";
logos[0].style.backgroundSize = "62px 34px";
}
}