automatic switch to accounts addressbook or all addressbooks depending on distribution list is a group

This commit is contained in:
Ralf Becker 2017-01-23 16:16:56 +01:00
parent 51aebe851e
commit 423a39e93b

View File

@ -656,12 +656,22 @@ app.classes.addressbook = AppJS.extend(
); );
}, },
/**
* OnChange for distribution list selectbox
*/
filter2_onchange: function() filter2_onchange: function()
{ {
var filter = this.et2.getWidgetById('filter');
var filter2 = this.et2.getWidgetById('filter2'); var filter2 = this.et2.getWidgetById('filter2');
var widget = this.et2.getWidgetById('nm'); var widget = this.et2.getWidgetById('nm');
var filter2_val = filter2.get_value();
if(filter2.get_value()=='add') // automatic switch to accounts addressbook or all addressbooks depending on distribution list is a group
if (filter2_val && (filter2_val < 0) !== (filter.get_value() === '0'))
{
filter.set_value(filter2_val < 0 ? '0' : '');
}
if(filter2_val == 'add')
{ {
this.add_new_list(typeof widget == 'undefined' ? this.et2.getWidgetById('filter').value : widget.header.filter.get_value()); this.add_new_list(typeof widget == 'undefined' ? this.et2.getWidgetById('filter').value : widget.header.filter.get_value());
this.value=''; this.value='';