preferences + peers + transfers = user dialog

This commit is contained in:
rlx 2016-01-13 12:30:18 +05:30
commit dc3d59ca42
4 changed files with 54 additions and 209 deletions

View file

@ -1,9 +1,10 @@
'use strict';
oml.ui.preferencesDialog = function() {
oml.ui.preferencesPanel = function() {
var preferences = oml.user.preferences,
ui = oml.user.ui,
var ui = oml.user.ui,
preferences = oml.user.preferences,
items = {
account: [
@ -237,81 +238,14 @@ oml.ui.preferencesDialog = function() {
})
.appendTo($helpElement),
$panel = Ox.SplitPanel({
that = Ox.SplitPanel({
elements: [
{element: $list, size: 128},
{element: $main}
],
orientation: 'horizontal'
}),
$usersButton = Ox.Button({
id: 'users',
style: 'squared',
title: Ox._('Users...')
})
.bindEvent({
click: function() {
oml.UI.set({page: 'users'});
}
}),
$notificationsButton = Ox.Button({
id: 'notifications',
style: 'squared',
title: Ox._('Notifications...')
})
.bindEvent({
click: function() {
oml.UI.set({page: 'notifications'});
}
}),
$transfersButton = Ox.Button({
id: 'transfers',
title: Ox._('Transfers...')
})
.bindEvent({
click: function() {
oml.UI.set({page: 'transfers'});
}
}),
that = Ox.Dialog({
buttons: [
$usersButton,
$notificationsButton,
$transfersButton,
{},
Ox.Button({
id: 'done',
style: 'squared',
title: Ox._('Done')
})
.bindEvent({
click: function() {
that.close();
}
})
],
closeButton: true,
content: $panel,
fixedSize: true,
height: 384,
keys: {escape: 'close'},
removeOnClose: true,
title: Ox._('Preferences'),
width: 768
})
.bindEvent({
open: function() {
$list.gainFocus();
},
close: function() {
if (ui.page == 'preferences') {
oml.UI.set({page: ''});
}
},
'oml_part.preferences': function() {
if (ui.page == 'preferences') {
that.updateElement();
@ -319,6 +253,7 @@ oml.ui.preferencesDialog = function() {
}
});
function displayHelp(item) {
$helpLabel.options({title: item.title});
$help.html(Ox._(item.help));
@ -467,10 +402,6 @@ oml.ui.preferencesDialog = function() {
$formElement.append($form);
$helpElement.hide();
$usersButton[part == 'peering' ? 'show' : 'hide']();
$notificationsButton[part == 'peering' ? 'show' : 'hide']();
$transfersButton[part == 'network' ? 'show' : 'hide']();
return that;
};