forked from 0x2620/pandora
use new array input options
This commit is contained in:
parent
55bcb58f4c
commit
1e2e87ba84
1 changed files with 50 additions and 46 deletions
|
@ -676,8 +676,9 @@ pandora.ui.documentsPanel = function(options) {
|
||||||
].concat(
|
].concat(
|
||||||
pandora.site.entities && pandora.site.entities.length
|
pandora.site.entities && pandora.site.entities.length
|
||||||
? Ox.ArrayInput({
|
? Ox.ArrayInput({
|
||||||
getInput: function(width) {
|
input: {
|
||||||
$input = Ox.FormElementGroup({
|
get: function(width) {
|
||||||
|
return Ox.FormElementGroup({
|
||||||
elements: [
|
elements: [
|
||||||
Ox.Select({
|
Ox.Select({
|
||||||
items: pandora.site.entities.map(function(entity) {
|
items: pandora.site.entities.map(function(entity) {
|
||||||
|
@ -713,17 +714,20 @@ pandora.ui.documentsPanel = function(options) {
|
||||||
],
|
],
|
||||||
width: width
|
width: width
|
||||||
});
|
});
|
||||||
return $input;
|
},
|
||||||
|
getEmpty: function() {
|
||||||
|
return [pandora.site.entities[0].id, ''];
|
||||||
},
|
},
|
||||||
isEmpty: function(value) {
|
isEmpty: function(value) {
|
||||||
return value[1] === '';
|
return value[1] === '';
|
||||||
},
|
},
|
||||||
label: Ox._('Entities'),
|
setWidth: function($input, width) {
|
||||||
setWidth: function(width) {
|
|
||||||
$input.options('elements')[1].options({
|
$input.options('elements')[1].options({
|
||||||
width: width - labelWidth
|
width: width - labelWidth
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
|
}
|
||||||
|
label: Ox._('Entities'),
|
||||||
value: item.entities.map(function(entity) {
|
value: item.entities.map(function(entity) {
|
||||||
return [entity.type, entity.name];
|
return [entity.type, entity.name];
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in a new issue