peers dialog: preselect first item; fix message display

This commit is contained in:
rlx 2016-01-16 15:12:33 +05:30
parent 89873f0c4d
commit 30f6f6860f

View file

@ -87,7 +87,7 @@ oml.ui.peersPanel = function() {
var peering = Ox.throttle(function() { var peering = Ox.throttle(function() {
updateUsers(); updateUsers();
}, 1000); }, 1000);
if(oml.user.ui.page == 'peers') { if (oml.user.ui.page == 'peers') {
oml.bindEvent({peering: peering}); oml.bindEvent({peering: peering});
} }
@ -136,6 +136,7 @@ oml.ui.peersPanel = function() {
.css({height: '16px'}) .css({height: '16px'})
.bindEvent({ .bindEvent({
select: function(data) { select: function(data) {
Ox.print('SELECT:', data)
if (data.ids.length) { if (data.ids.length) {
selectItem($list); selectItem($list);
renderUser({section: data.ids[0]}); renderUser({section: data.ids[0]});
@ -335,6 +336,19 @@ oml.ui.peersPanel = function() {
}) })
.appendTo($form); .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({ Ox.Label({
@ -356,7 +370,6 @@ oml.ui.peersPanel = function() {
labelWidth: 128, labelWidth: 128,
placeholder: Ox._('none'), placeholder: Ox._('none'),
style: 'squared', style: 'squared',
value: user.message || '',
width: 480 width: 480
}) })
.css({ .css({
@ -592,7 +605,10 @@ oml.ui.peersPanel = function() {
} }
that.updateElement = function() { that.updateElement = function() {
updateUsers(); updateUsers(function() {
selectItem($lists[0], 'invitations');
renderUser({section: 'invitations'});
});
return that; return that;
}; };