[polari/wip/fmuellner/combined-gsoc: 62/103] Popovers are now created on demand, not when the tag is created



commit fd74cbc8230e5d58a9cc2b4b3906a57719cfd69e
Author: raresv <rares visalom gmail com>
Date:   Thu Jul 14 22:58:57 2016 +0300

    Popovers are now created on demand, not when the tag is created

 src/chatView.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 54b7275..f8a5aa6 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1285,7 +1285,7 @@ const ChatView = new Lang.Class({
 
     _createNickTag: function(name) {
         let tag = new ButtonTag({ name: name });
-        tag._popover = new UserList.UserPopover({ relative_to: this._view, margin: 0, room: this._room, 
userTracker: this._userStatusMonitor.getUserTrackerForAccount(this._room.account), width_request: 280 });
+        //tag._popover = new UserList.UserPopover({ relative_to: this._view, margin: 0, room: this._room, 
userTracker: this._userStatusMonitor.getUserTrackerForAccount(this._room.account), width_request: 280 });
         tag.connect('clicked', Lang.bind(this, this._onNickTagClicked));
         return tag;
     },
@@ -1317,6 +1317,9 @@ const ChatView = new Lang.Class({
         //TODO: special chars?
         let actualNickName = view.get_buffer().get_slice(start, end, false);
 
+        if (!tag._popover)
+            tag._popover = new UserList.UserPopover({ relative_to: this._view, margin: 0, room: this._room, 
userTracker: this._userStatusMonitor.getUserTrackerForAccount(this._room.account), width_request: 280 });
+
         tag._popover.nickname = actualNickName;
 
         tag._popover.pointing_to = rect1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]