Add in_selection() to rcube_treelist_widget

So code working on all lists doesn't have to check widget type
to work with selection.
pull/5895/merge
Aleksander Machniak 5 years ago
parent 4bce2c4389
commit d646a10217

@ -96,6 +96,7 @@ function rcube_treelist_widget(node, p)
this.get_item = get_item;
this.get_node = get_node;
this.get_selection = get_selection;
this.in_selection = in_selection;
this.get_next = get_next;
this.get_prev = get_prev;
this.get_single_selection = get_selection;
@ -295,6 +296,15 @@ function rcube_treelist_widget(node, p)
return selection;
}
/**
* Check if given id is selected
* This is for consistency with rcube_list_widget
*/
function in_selection(id)
{
return selection == id;
}
/**
* Return the DOM element of the list item with the given ID
*/

Loading…
Cancel
Save