This commit is contained in:
Alejandro Gallardo Escobar 2018-09-18 15:33:14 +02:00
parent 0fef339a13
commit e5ff2b956c
2 changed files with 11 additions and 4 deletions

View File

@ -1544,11 +1544,14 @@ function loadFieldsFromDB(item) {
if (key == 'linked_layout_status_type')
$("select[name=linked_map_status_calculation_type]").val(val).change();
if (key == 'id_layout_linked') {
if (data['linked_layout_node_id'] == null)
if (data['linked_layout_node_id'] == null) {
$("select[name=map_linked]").val(val).change();
else
$("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]")
.prop("selected", true).change();
}
else {
var $option = $("select[name=map_linked] > option[data-node-id=" + data['linked_layout_node_id'] + "][value=" + val + "]");
if ($option.length === 0) $option = $("select[name=map_linked] > option[value=" + val + "]");
$option.prop("selected", true).parent().change();
}
}
if (key == 'linked_layout_node_id')
$("input[name=linked_map_node_id]").val(val);

View File

@ -773,6 +773,10 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items_advance['map_linked_row']['html'] .= ob_get_clean();
}
else {
$visual_maps = array_reduce($visual_maps, function ($all, $item) {
$all[$item["id"]] = $item["name"];
return $all;
}, array());
$form_items_advance['map_linked_row']['html'] .= html_print_select(
$visual_maps, 'map_linked', 0, 'onLinkedMapChange(event)', __('None'), 0, true
);