openmedialibrary/static/js/userDialog.js

75 lines
1.9 KiB
JavaScript
Raw Normal View History

2016-01-13 06:42:59 +00:00
'use strict';
oml.ui.userDialog = function() {
var ui = oml.user.ui,
$panel = Ox.TabPanel({
content: function(id) {
var name = id + 'Panel';
return oml.$ui[name] = oml.ui[name]();
},
style: 'squared',
tabs: [
{
id: 'preferences',
title: Ox._('Preferences'),
selected: ui.page == 'preferences'
},
2019-01-17 10:30:22 +00:00
].concat(oml.readOnly ? [] : [
2016-01-13 06:42:59 +00:00
{
id: 'peers',
title: Ox._('Peers'),
selected: ui.page == 'peers'
},
{
id: 'transfers',
title: Ox._('Transfers'),
selected: ui.page == 'transfers'
}
2019-01-17 10:30:22 +00:00
])
2016-01-13 06:42:59 +00:00
})
.bindEvent({
change: function(data) {
oml.UI.set({page: data.selected});
}
}),
that = Ox.Dialog({
buttons: [
Ox.Button({
id: 'done',
style: 'squared',
title: Ox._('Done')
})
.bindEvent({
click: function() {
that.close();
}
})
],
closeButton: true,
content: $panel,
fixedSize: true,
height: 408,
keys: {escape: 'done'},
removeOnClose: true,
2016-01-18 06:16:21 +00:00
title: 'Open Media Library',
2016-01-13 06:42:59 +00:00
width: 768
})
.bindEvent({
close: function() {
oml.UI.set({page: ''});
},
open: function() {
// ...
},
oml_page: function() {
// ...
}
});
return that;
2019-01-17 10:30:22 +00:00
};