update entities dialog

This commit is contained in:
rolux 2014-11-20 16:31:25 +00:00
parent a1a25ebefb
commit 055018f12e

View file

@ -32,6 +32,7 @@ pandora.ui.entitiesDialog = function(options) {
$findInput = Ox.Input({ $findInput = Ox.Input({
clear: true, clear: true,
placeholder: 'Find', placeholder: 'Find',
submitOnKeypress: true,
width: 122 width: 122
}) })
.css({ .css({
@ -98,9 +99,15 @@ pandora.ui.entitiesDialog = function(options) {
$listStatus.html(text[0].toUpperCase() + text.slice(1)); $listStatus.html(text[0].toUpperCase() + text.slice(1));
}, },
select: function(data) { select: function(data) {
var text = Ox.formatCount(
data.ids,
Ox._('entity'),
OX._('entities')
) + ' ' + Ox._('selected');
selected = data.ids; selected = data.ids;
renderEntity(); renderEntity();
renderForm(); renderForm();
$itemStatus.html(text[0].toUpperCase() + text.slice(1));
} }
}), }),
@ -335,11 +342,11 @@ pandora.ui.entitiesDialog = function(options) {
title: Ox._(key.title), title: Ox._(key.title),
width: 248 - Ox.SCROLLBAR_SIZE width: 248 - Ox.SCROLLBAR_SIZE
}) })
.css({margin: '2px'}) .css({margin: '2px 2px 4px 2px'})
.appendTo($form), .appendTo($form),
$input; $input;
if (key.type == 'document') { if (key.type == 'document') {
$input = Ox.Input({autovalidate: /[A-Z]/}); $input = Ox.Input({autovalidate: /^[A-Z]+?$/});
} else if (key.type == 'float') { } else if (key.type == 'float') {
$input = Ox.Input({type: 'float'}); $input = Ox.Input({type: 'float'});
} else if (key.type == 'int') { } else if (key.type == 'int') {
@ -355,11 +362,11 @@ pandora.ui.entitiesDialog = function(options) {
}); });
} }
$input.options({ $input.options({
disabled: key == 'id', disabled: key.id == 'id',
value: data[key], value: data[key.id],
width: 248 - Ox.SCROLLBAR_SIZE width: 248 - Ox.SCROLLBAR_SIZE
}) })
.css({margin: '2px'}) .css({margin: '2px 2px 4px 2px'})
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
pandora.api.editEntity(Ox.extend({ pandora.api.editEntity(Ox.extend({