Update to support showing owner on the infobar

This commit is contained in:
Wu Cheng-Han 2016-10-10 20:32:20 +08:00
parent 7a85d62b77
commit 3175616573
6 changed files with 55 additions and 8 deletions

View file

@ -7,6 +7,7 @@ var lastchangeui = {
user: $(".ui-lastchangeuser"),
nouser: $(".ui-no-lastchangeuser")
}
var ownerui = $(".ui-owner");
function updateLastChange() {
if (!lastchangeui) return;
@ -41,6 +42,23 @@ function updateLastChangeUser() {
}
}
var owner = null;
var ownerprofile = null;
function updateOwner() {
if (ownerui) {
if (owner && ownerprofile && owner !== lastchangeuser) {
var icon = ownerui.children('i');
icon.attr('title', ownerprofile.name).tooltip('fixTitle');
var styleString = 'background-image:url(' + ownerprofile.photo + ')';
if (ownerprofile.photo && icon.attr('style') !== styleString)
icon.attr('style', styleString);
ownerui.show();
} else {
ownerui.hide();
}
}
}
//get title
function getTitle(view) {
var title = "";