On page load, if the “Start minimized” option (Make the tree appear minimized on the form by default) is selected, that minimize each tree, except for lists that contain a checked box.

On page load, how to minimize each tree even for lists that contain a checked box?

Start minimized is checked
Leaves Only is checked
Track List is checked
Unlimited

I think we have to add some lines in ‘term_reference_tree.js’.
I knew PHP but not Javascript so thanks in advance for your help.

In the next version, it will be nice to get two different options « Start minimized in all cases » and « Start minimized except for lists that contain a checked box ».

Comments

Philou88’s picture

I apparently found the modification to do at the end of "term_reference_tree.widget.inc".

    '#depth' => $depth,
  );

  // $container['#level_start_minimized'] = $depth > 1 && $element['#start_minimized'] && !($term->children_selected);
  $container['#level_start_minimized'] = $depth > 1 && $element['#start_minimized'];

  foreach ($term->children as $child) {

alex_optim’s picture

Status: Active » Fixed
alex_optim’s picture

Status: Fixed » Closed (fixed)