From 423a39e93bcdadb6751a9472fd1b9d121bd181a4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 23 Jan 2017 16:16:56 +0100 Subject: [PATCH] automatic switch to accounts addressbook or all addressbooks depending on distribution list is a group --- addressbook/js/app.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addressbook/js/app.js b/addressbook/js/app.js index 371151cba3..f24b3dbc48 100644 --- a/addressbook/js/app.js +++ b/addressbook/js/app.js @@ -656,12 +656,22 @@ app.classes.addressbook = AppJS.extend( ); }, + /** + * OnChange for distribution list selectbox + */ filter2_onchange: function() { + var filter = this.et2.getWidgetById('filter'); var filter2 = this.et2.getWidgetById('filter2'); 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.value='';