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
1 changed files with 19 additions and 3 deletions

View File

@ -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;
};