update entities dialog

This commit is contained in:
rolux 2014-11-20 16:13:08 +00:00
parent 9d916d2d9f
commit a1a25ebefb

View file

@ -42,9 +42,9 @@ pandora.ui.entitiesDialog = function(options) {
change: function(data) { change: function(data) {
$list.options({ $list.options({
query: { query: {
conditions: [ conditions: data.value ? [
{key: 'name', operator: '=', value: data.value} {key: 'name', operator: '=', value: data.value}
], ] : [],
operator: '&' operator: '&'
} }
}); });
@ -196,7 +196,11 @@ pandora.ui.entitiesDialog = function(options) {
$inputs = [], $inputs = [],
$form = Ox.Element(), $form = Ox.Element()
.css({
overflowY: 'scroll',
padding: '2px'
}),
$itemStatus = Ox.Element() $itemStatus = Ox.Element()
.css({ .css({
@ -329,11 +333,9 @@ pandora.ui.entitiesDialog = function(options) {
keys.forEach(function(key) { keys.forEach(function(key) {
var $label = Ox.Label({ var $label = Ox.Label({
title: Ox._(key.title), title: Ox._(key.title),
width: 248 width: 248 - Ox.SCROLLBAR_SIZE
})
.css({
margin: '4px'
}) })
.css({margin: '2px'})
.appendTo($form), .appendTo($form),
$input; $input;
if (key.type == 'document') { if (key.type == 'document') {
@ -347,12 +349,17 @@ pandora.ui.entitiesDialog = function(options) {
} else if (key.type[0] == 'string') { } else if (key.type[0] == 'string') {
$input = Ox.ArrayInput(); $input = Ox.ArrayInput();
} else if (key.type == 'text') { } else if (key.type == 'text') {
$input = Ox.Input({height: 248, type: 'textarea'}); $input = Ox.Input({
height: 248 - Ox.SCROLLBAR_SIZE,
type: 'textarea'
});
} }
$input.options({ $input.options({
value: data.key, disabled: key == 'id',
width: 248 value: data[key],
width: 248 - Ox.SCROLLBAR_SIZE
}) })
.css({margin: '2px'})
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
pandora.api.editEntity(Ox.extend({ pandora.api.editEntity(Ox.extend({