mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 08:04:45 -04:00
Improved update last info methods, only change DOM when necessary
This commit is contained in:
parent
30d194bba4
commit
526f5c7e2e
3 changed files with 31 additions and 17 deletions
|
@ -14,16 +14,20 @@ function updateLastChange() {
|
|||
}
|
||||
setInterval(updateLastChange, 60000);
|
||||
|
||||
function updateLastChangeUser(data) {
|
||||
if (data.lastchangeuserprofile) {
|
||||
var icon = lastchangeui.user.children('i');
|
||||
icon.attr('title', data.lastchangeuserprofile.name).tooltip('fixTitle');
|
||||
icon.attr('style', 'background-image:url(' + data.lastchangeuserprofile.photo + ')');
|
||||
lastchangeui.user.show();
|
||||
lastchangeui.nouser.hide();
|
||||
} else {
|
||||
lastchangeui.user.hide();
|
||||
lastchangeui.nouser.show();
|
||||
var lastchangeuser = null;
|
||||
var lastchangeuserprofile = null;
|
||||
function updateLastChangeUser() {
|
||||
if (lastchangeui) {
|
||||
if (lastchangeuser && lastchangeuserprofile) {
|
||||
var icon = lastchangeui.user.children('i');
|
||||
icon.attr('title', lastchangeuserprofile.name).tooltip('fixTitle');
|
||||
icon.attr('style', 'background-image:url(' + lastchangeuserprofile.photo + ')');
|
||||
lastchangeui.user.show();
|
||||
lastchangeui.nouser.hide();
|
||||
} else {
|
||||
lastchangeui.user.hide();
|
||||
lastchangeui.nouser.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue