update entitiesDialog

This commit is contained in:
rolux 2014-11-19 18:31:06 +00:00
parent e6b5dcb346
commit fa7b385892

View file

@ -79,8 +79,12 @@ pandora.ui.entitiesDialog = function(options) {
}) })
.bindEvent({ .bindEvent({
init: function(data) { init: function(data) {
// FIXME: not localized var text = Ox.formatCount(
$listStatus.html(Ox.formatCount(data.items, 'entity', 'entities')) data.items,
Ox._('entity'),
Ox._('entities')
)
$listStatus.html(text[0].toUpperCase() + text.slice(1));
} }
}), }),
@ -117,7 +121,7 @@ pandora.ui.entitiesDialog = function(options) {
$itemMenu = Ox.MenuButton({ $itemMenu = Ox.MenuButton({
items: [ items: [
{'id': 'add', title: Ox._('Add Entity'), keyboard: 'control n'}, {'id': 'add', title: Ox._('Add Entity'), keyboard: 'control n'},
{'id': 'delete', title: Ox._('Delete Entity'), keyboard: 'delete'} {'id': 'delete', title: Ox._('Delete Entity...'), keyboard: 'delete'}
], ],
title: 'set', title: 'set',
tooltip: Ox._('Options'), tooltip: Ox._('Options'),
@ -130,15 +134,41 @@ pandora.ui.entitiesDialog = function(options) {
.bindEvent({ .bindEvent({
click: function(data) { click: function(data) {
if (data.id == 'add') { if (data.id == 'add') {
// ... pandora.api.addEntity({}, function(result) {
Ox.print('$$$$', result);
Ox.Request.clearCache('findEntities');
$list.reloadList().options({
selected: [result.data.id]
});
})
} else if (data.id == 'delete') { } else if (data.id == 'delete') {
// ... // ...
} }
} }
}), }),
$deselectButton = Ox.Button({
title: 'close'
tooltip: Ox._('Done'),
type: 'image'
})
.css({
float: 'right',
margin: '4px'
})
.hide()
.bindEvent({
click: function() {
pandora.UI.set({
'entitiesSelection.' + type,
[]
});
}
})
$itemBar = Ox.Bar({size: 24}) $itemBar = Ox.Bar({size: 24})
.append($itemMenu), .append($itemMenu)
.append($deselectButton),
$itemStatus = Ox.Element() $itemStatus = Ox.Element()
.css({ .css({