From 3175616573a9346f8ae2731a8a963b28c42224c3 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Mon, 10 Oct 2016 20:32:20 +0800 Subject: Update to support showing owner on the infobar --- public/js/extra.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'public/js/extra.js') diff --git a/public/js/extra.js b/public/js/extra.js index 77f298f9..6c2e2d4a 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -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 = ""; -- cgit v1.2.3