Commit 6ffca8f6 authored by Nigel McNie's avatar Nigel McNie
Browse files

When uploading a profile icon for the first time, update all instances of it...

When uploading a profile icon for the first time, update all instances of it in the sidebar too as it will be the default.
parent 83d7d60f
......@@ -125,6 +125,18 @@ var table = new TableRenderer(
table.updateOnLoad();
table.emptycontent = {$strnoimagesfound};
table.paginate = false;
table.updatecallback = function(response) {
var defaultIcon = filter(function (i) { return i.isdefault == 't'; }, response.data);
if (defaultIcon.length) {
defaultIcon = defaultIcon[0].id;
forEach(getElementsByTagAndClassName('img', null, 'column-right'), function(i) {
if (i.src.match(/thumb\.php\?type=profileiconbyid/)) {
i.src = i.src.replace(/id=[0-9]+/, 'id=' + String(defaultIcon));
}
});
}
};
var uploadingMessage = TR(null,
TD(null, {$struploadingfile})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment