From 30f6f6860f7def782f2193fd27684ce440f55a0a Mon Sep 17 00:00:00 2001 From: rlx Date: Sat, 16 Jan 2016 15:12:33 +0530 Subject: [PATCH] peers dialog: preselect first item; fix message display --- static/js/peersPanel.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/static/js/peersPanel.js b/static/js/peersPanel.js index 80abd94..bf1b57c 100644 --- a/static/js/peersPanel.js +++ b/static/js/peersPanel.js @@ -87,7 +87,7 @@ oml.ui.peersPanel = function() { var peering = Ox.throttle(function() { updateUsers(); }, 1000); - if(oml.user.ui.page == 'peers') { + if (oml.user.ui.page == 'peers') { oml.bindEvent({peering: peering}); } @@ -136,6 +136,7 @@ oml.ui.peersPanel = function() { .css({height: '16px'}) .bindEvent({ select: function(data) { + Ox.print('SELECT:', data) if (data.ids.length) { selectItem($list); renderUser({section: data.ids[0]}); @@ -335,6 +336,19 @@ oml.ui.peersPanel = function() { }) .appendTo($form); + Ox.Input({ + readonly: true, + label: Ox._('Message'), + labelWidth: 128, + style: 'squared', + value: user.message || '', + width: 480 + }) + .css({ + marginTop: '8px' + }) + .appendTo($form); + } Ox.Label({ @@ -356,7 +370,6 @@ oml.ui.peersPanel = function() { labelWidth: 128, placeholder: Ox._('none'), style: 'squared', - value: user.message || '', width: 480 }) .css({ @@ -592,7 +605,10 @@ oml.ui.peersPanel = function() { } that.updateElement = function() { - updateUsers(); + updateUsers(function() { + selectItem($lists[0], 'invitations'); + renderUser({section: 'invitations'}); + }); return that; };