entities dialog: update form layout

This commit is contained in:
rolux 2014-11-20 18:30:57 +00:00
parent c9fa0c78cd
commit 6fc0ce4d87

View file

@ -206,7 +206,7 @@ pandora.ui.entitiesDialog = function(options) {
$form = Ox.Element() $form = Ox.Element()
.css({ .css({
overflowY: 'scroll', overflowY: 'scroll',
padding: '2px' padding: '4px'
}), }),
$itemStatus = Ox.Element() $itemStatus = Ox.Element()
@ -337,12 +337,14 @@ pandora.ui.entitiesDialog = function(options) {
} }
var keys = Ox.getObjectById(pandora.site.entities, type).keys; var keys = Ox.getObjectById(pandora.site.entities, type).keys;
$form.empty() $form.empty()
keys.forEach(function(key) { keys.forEach(function(key, index) {
var $label = Ox.Label({ var $label = Ox.Label({
title: Ox._(key.title), title: Ox._(key.title),
width: 248 - Ox.SCROLLBAR_SIZE width: 240 - Ox.SCROLLBAR_SIZE
})
.css({
margin: index == 0 ? '4px' : '16px 4px 4px 4px'
}) })
.css({margin: '2px 2px 4px 2px'})
.appendTo($form), .appendTo($form),
$input; $input;
if (key.type === 'document') { if (key.type === 'document') {
@ -357,16 +359,16 @@ pandora.ui.entitiesDialog = function(options) {
$input = Ox.ArrayInput(); $input = Ox.ArrayInput();
} else if (key.type === 'text') { } else if (key.type === 'text') {
$input = Ox.Input({ $input = Ox.Input({
height: 248 - Ox.SCROLLBAR_SIZE, height: 240 - Ox.SCROLLBAR_SIZE,
type: 'textarea' type: 'textarea'
}); });
} }
$input.options({ $input.options({
disabled: key.id == 'id', disabled: key.id == 'id',
value: result.data[key.id], value: result.data[key.id],
width: 248 - Ox.SCROLLBAR_SIZE width: 240 - Ox.SCROLLBAR_SIZE
}) })
.css({margin: '2px 2px 16px 2px'}) .css({margin: '4px'})
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
pandora.api.editEntity(Ox.extend({ pandora.api.editEntity(Ox.extend({