mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:42 +01:00
Preferences: Add a preference for if select multiple dropdowns stay open or closes immediately after selection
This commit is contained in:
parent
b557eb7b83
commit
358cc70d66
@ -244,12 +244,22 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
|||||||
*/
|
*/
|
||||||
private _block_change_event = false;
|
private _block_change_event = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the dropdown after user selects an option.
|
||||||
|
* Only applies when multiple="true". We initialize it in constructor to the common preference "select_multiple_close"
|
||||||
|
* @type {boolean}
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
private _close_on_select : boolean;
|
||||||
|
|
||||||
constructor(...args : any[])
|
constructor(...args : any[])
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
// We want this on more often than off
|
// We want this on more often than off
|
||||||
this.hoist = true;
|
this.hoist = true;
|
||||||
|
|
||||||
|
this._close_on_select = this.egw().preference("select_multiple_close") == "close";
|
||||||
|
|
||||||
this._triggerChange = this._triggerChange.bind(this);
|
this._triggerChange = this._triggerChange.bind(this);
|
||||||
this._doResize = this._doResize.bind(this);
|
this._doResize = this._doResize.bind(this);
|
||||||
this._handleMouseWheel = this._handleMouseWheel.bind(this);
|
this._handleMouseWheel = this._handleMouseWheel.bind(this);
|
||||||
@ -683,8 +693,8 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Always close the dropdown if an option is clicked, even if multiple=true. This differs from SlSelect,
|
* Apply the user preference to close the dropdown if an option is clicked, even if multiple=true.
|
||||||
* which leaves the dropdown open for multiple=true
|
* The default (from SlSelect) leaves the dropdown open for multiple=true
|
||||||
*
|
*
|
||||||
* @param {MouseEvent} event
|
* @param {MouseEvent} event
|
||||||
* @private
|
* @private
|
||||||
@ -696,14 +706,17 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
|||||||
// Don't hide dropdown when clicking on select. That can close it after user opens it.
|
// Don't hide dropdown when clicking on select. That can close it after user opens it.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.dropdown.hide().then(() =>
|
if(this._close_on_select)
|
||||||
{
|
{
|
||||||
if(typeof this.handleMenuHide == "function")
|
this.dropdown.hide().then(() =>
|
||||||
{
|
{
|
||||||
// Make sure search gets hidden
|
if(typeof this.handleMenuHide == "function")
|
||||||
this.handleMenuHide();
|
{
|
||||||
}
|
// Make sure search gets hidden
|
||||||
});
|
this.handleMenuHide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,6 +83,10 @@ export class Et2SelectEmail extends Et2Select
|
|||||||
constructor(...args : any[])
|
constructor(...args : any[])
|
||||||
{
|
{
|
||||||
super(...args);
|
super(...args);
|
||||||
|
|
||||||
|
// Always off for select email, per ticket #79694
|
||||||
|
this._close_on_select = true;
|
||||||
|
|
||||||
this.search = true;
|
this.search = true;
|
||||||
this.searchUrl = "EGroupware\\Api\\Etemplate\\Widget\\Taglist::ajax_email";
|
this.searchUrl = "EGroupware\\Api\\Etemplate\\Widget\\Taglist::ajax_email";
|
||||||
this.allowFreeEntries = true;
|
this.allowFreeEntries = true;
|
||||||
|
@ -25,6 +25,10 @@ class preferences_hooks
|
|||||||
*/
|
*/
|
||||||
static public function settings($hook_data)
|
static public function settings($hook_data)
|
||||||
{
|
{
|
||||||
|
$select_multiple_close = array(
|
||||||
|
'open' => lang('Stay open'),
|
||||||
|
'close' => lang('Close after selection')
|
||||||
|
);
|
||||||
$navbar_format = array(
|
$navbar_format = array(
|
||||||
'icons' => lang('Icons only'),
|
'icons' => lang('Icons only'),
|
||||||
'icons_and_text' => lang('Icons and text'),
|
'icons_and_text' => lang('Icons and text'),
|
||||||
@ -197,7 +201,7 @@ class preferences_hooks
|
|||||||
'help' => 'Fast update add new entries always top of the list and updates existing ones in place, unless list is sorted by last modified. Exact updates do a full refresh, if the list is not sorted by last modified.',
|
'help' => 'Fast update add new entries always top of the list and updates existing ones in place, unless list is sorted by last modified. Exact updates do a full refresh, if the list is not sorted by last modified.',
|
||||||
'default'=> 'lazy'
|
'default'=> 'lazy'
|
||||||
),
|
),
|
||||||
'template_set' => array(
|
'template_set' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Interface/Template Selection',
|
'label' => 'Interface/Template Selection',
|
||||||
'name' => 'template_set',
|
'name' => 'template_set',
|
||||||
@ -208,7 +212,7 @@ class preferences_hooks
|
|||||||
'forced' => file_exists(EGW_SERVER_ROOT.'/pixelegg') ? 'pixelegg' : 'idots',
|
'forced' => file_exists(EGW_SERVER_ROOT.'/pixelegg') ? 'pixelegg' : 'idots',
|
||||||
'reload' => true
|
'reload' => true
|
||||||
),
|
),
|
||||||
'theme' => array(
|
'theme' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Theme (colors/fonts) Selection',
|
'label' => 'Theme (colors/fonts) Selection',
|
||||||
'name' => 'theme',
|
'name' => 'theme',
|
||||||
@ -216,97 +220,105 @@ class preferences_hooks
|
|||||||
'help' => 'A theme defines the colors and fonts used by the template.',
|
'help' => 'A theme defines the colors and fonts used by the template.',
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'forced' => file_exists(EGW_SERVER_ROOT.'/pixelegg') ? 'pixelegg' : 'idots',
|
'forced' => file_exists(EGW_SERVER_ROOT . '/pixelegg') ? 'pixelegg' : 'idots',
|
||||||
'reload' => true
|
'reload' => true
|
||||||
),
|
),
|
||||||
'darkmode' => array(
|
'darkmode' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Dark mode theme',
|
'label' => 'Dark mode theme',
|
||||||
'name' => 'darkmode',
|
'name' => 'darkmode',
|
||||||
'values' => array('0' => 'off', '1' => 'on', '2'=> 'auto'),
|
'values' => array('0' => 'off', '1' => 'on', '2' => 'auto'),
|
||||||
'help' => 'Dark mode theme',
|
'help' => 'Dark mode theme',
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'default' => '0'
|
'default' => '0'
|
||||||
),
|
),
|
||||||
'audio_effect'=> array(
|
'audio_effect' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Audio effect',
|
'label' => 'Audio effect',
|
||||||
'name' => 'audio_effect',
|
'name' => 'audio_effect',
|
||||||
'values' => array('0'=>lang('Disable'),'1'=>lang('Enable')),
|
'values' => array('0' => lang('Disable'), '1' => lang('Enable')),
|
||||||
'help' => 'Audio effect enables|disables sound effects used in the theme',
|
'help' => 'Audio effect enables|disables sound effects used in the theme',
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
),
|
),
|
||||||
'navbar_format' => array(
|
'navbar_format' => array(
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => 'Show navigation bar as',
|
||||||
|
'name' => 'navbar_format',
|
||||||
|
'values' => $navbar_format,
|
||||||
|
'help' => 'You can show the applications as icons only, icons with app-name or both.',
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => False,
|
||||||
|
'default' => 'icons_and_text',
|
||||||
|
),
|
||||||
|
'link_list_format' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Show navigation bar as',
|
'label' => 'Show links between eGroupWare aps as',
|
||||||
'name' => 'navbar_format',
|
'name' => 'link_list_format',
|
||||||
'values' => $navbar_format,
|
'values' => $link_list_format,
|
||||||
'help' => 'You can show the applications as icons only, icons with app-name or both.',
|
'help' => 'You can show the linked entries with icons only, icons with app-name or both.',
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'default'=> 'icons_and_text',
|
'forced' => 'icons',
|
||||||
),
|
),
|
||||||
'link_list_format' => array(
|
'select_multiple_close' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Show links between eGroupWare aps as',
|
'label' => 'Keep list open for selecting multiple',
|
||||||
'name' => 'link_list_format',
|
'name' => 'select_multiple_close',
|
||||||
'values' => $link_list_format,
|
'values' => $select_multiple_close,
|
||||||
'help' => 'You can show the linked entries with icons only, icons with app-name or both.',
|
'help' => 'When you can select multiple options, should the option list stay open until you close it, or close after you pick an option.',
|
||||||
'xmlrpc' => True,
|
'default' => 'open'
|
||||||
'admin' => False,
|
|
||||||
'forced' => 'icons',
|
|
||||||
),
|
),
|
||||||
'link_list_thumbnail' => array(
|
'link_list_thumbnail' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Display thumbnails for linked images',
|
'label' => 'Display thumbnails for linked images',
|
||||||
'name' => 'link_list_thumbnail',
|
'name' => 'link_list_thumbnail',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
'1' => lang('Yes'),
|
'1' => lang('Yes'),
|
||||||
'0' => lang('No'),
|
'0' => lang('No'),
|
||||||
),
|
),
|
||||||
'help' => 'Images linked to an entry can be displayed as thumbnails. You can turn this off to speed up page display.',
|
'help' => 'Images linked to an entry can be displayed as thumbnails. You can turn this off to speed up page display.',
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'forced' => '1',
|
'forced' => '1',
|
||||||
),
|
),
|
||||||
'select_mode' => array(
|
'select_mode' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Select additional lines in lists by',
|
'label' => 'Select additional lines in lists by',
|
||||||
'name' => 'select_mode',
|
'name' => 'select_mode',
|
||||||
'values' => array(
|
'values' => array(
|
||||||
'EGW_SELECTMODE_DEFAULT' => lang('holding Ctrl/Cmd key and click on the line'),
|
'EGW_SELECTMODE_DEFAULT' => lang('holding Ctrl/Cmd key and click on the line'),
|
||||||
'EGW_SELECTMODE_TOGGLE' => lang('just clicking on the line, like a checkbox'),
|
'EGW_SELECTMODE_TOGGLE' => lang('just clicking on the line, like a checkbox'),
|
||||||
),
|
),
|
||||||
'help' => 'If a line is already selected, further lines get either selected by holding Ctrl/Cmd key and clicking on them (to not unselect the current selected line), or by just clicking on them as for a checkbox. If no line is selected clicking on one allways selects it. Holding down Shift key selects everything between current select line and the one clicked.',
|
'help' => 'If a line is already selected, further lines get either selected by holding Ctrl/Cmd key and clicking on them (to not unselect the current selected line), or by just clicking on them as for a checkbox. If no line is selected clicking on one allways selects it. Holding down Shift key selects everything between current select line and the one clicked.',
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'default' => 'EGW_SELECTMODE_DEFAULT',
|
'default' => 'EGW_SELECTMODE_DEFAULT',
|
||||||
),
|
),
|
||||||
'account_selection' => array(
|
'account_selection' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'How do you like to select accounts',
|
'label' => 'How do you like to select accounts',
|
||||||
'name' => 'account_selection',
|
'name' => 'account_selection',
|
||||||
'values' => $account_sels,
|
'values' => $account_sels,
|
||||||
'help' => lang('The selectbox shows all available users (can be very slow on big installs with many users). The popup can search users by name or group.').' '.
|
'help' => lang('The selectbox shows all available users (can be very slow on big installs with many users). The popup can search users by name or group.') . ' ' .
|
||||||
lang('The two last options limit the visibility of other users. Therefore they should be forced and apply NOT to administrators.'),
|
lang('The two last options limit the visibility of other users. Therefore they should be forced and apply NOT to administrators.'),
|
||||||
'run_lang' => false,
|
'run_lang' => false,
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'default'=> 'selectbox'
|
'default' => 'selectbox'
|
||||||
),
|
),
|
||||||
'account_display' => array(
|
'account_display' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'How do you like to display accounts',
|
'label' => 'How do you like to display accounts',
|
||||||
'name' => 'account_display',
|
'name' => 'account_display',
|
||||||
'values' => $account_display,
|
'values' => $account_display,
|
||||||
'help' => 'Set this to your convenience. For security reasons, you might not want to show your Loginname in public.',
|
'help' => 'Set this to your convenience. For security reasons, you might not want to show your Loginname in public.',
|
||||||
'xmlrpc' => True,
|
'xmlrpc' => True,
|
||||||
'admin' => False,
|
'admin' => False,
|
||||||
'default'=> 'lastname',
|
'default' => 'lastname',
|
||||||
),
|
),
|
||||||
'show_currentusers' => array(
|
'show_currentusers' => array(
|
||||||
'type' => 'check',
|
'type' => 'check',
|
||||||
'label' => 'Show number of current users',
|
'label' => 'Show number of current users',
|
||||||
'name' => 'show_currentusers',
|
'name' => 'show_currentusers',
|
||||||
@ -315,7 +327,7 @@ class preferences_hooks
|
|||||||
'admin' => True,
|
'admin' => True,
|
||||||
'forced' => true,
|
'forced' => true,
|
||||||
),
|
),
|
||||||
'scroll_area'=> array(
|
'scroll_area' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'Applications list scroll area',
|
'label' => 'Applications list scroll area',
|
||||||
'name' => 'scroll_area',
|
'name' => 'scroll_area',
|
||||||
|
@ -104,6 +104,7 @@ interface/template selection preferences en Interface | Template
|
|||||||
it sets content size (text only) according to selected size. preferences en It sets content size (text only) according to selected size.
|
it sets content size (text only) according to selected size. preferences en It sets content size (text only) according to selected size.
|
||||||
just clicking on the line, like a checkbox preferences en just clicking on the line, like a checkbox
|
just clicking on the line, like a checkbox preferences en just clicking on the line, like a checkbox
|
||||||
kama theme preferences en Kama theme
|
kama theme preferences en Kama theme
|
||||||
|
keep list open for selecting multiple preferences en Keep list open for selecting multiple
|
||||||
language preferences en Language
|
language preferences en Language
|
||||||
look & feel preferences en Look & feel
|
look & feel preferences en Look & feel
|
||||||
lowercase letters preferences en lowercase letters
|
lowercase letters preferences en lowercase letters
|
||||||
@ -194,6 +195,7 @@ unit of displayed font sizes: either "px" as used eg. for web-pages or "pt" as u
|
|||||||
uppercase letters preferences en uppercase letters
|
uppercase letters preferences en uppercase letters
|
||||||
use default preferences en Use default
|
use default preferences en Use default
|
||||||
users choice preferences en Users choice
|
users choice preferences en Users choice
|
||||||
|
when you can select multiple options, should the option list stay open until you close it, or close after you pick an option. preferences en When you can select multiple options, should the option list stay open until you close it, or close after you pick an option.
|
||||||
when you say yes the home and logout buttons are presented as applications in the main top applcation bar. preferences en Show Home and Logout buttons as applications in the top bar.
|
when you say yes the home and logout buttons are presented as applications in the main top applcation bar. preferences en Show Home and Logout buttons as applications in the top bar.
|
||||||
which charset should be used for the csv export. the system default is the charset of this egroupware installation. addressbook en Select character set for the CSV Import|Export.
|
which charset should be used for the csv export. the system default is the charset of this egroupware installation. addressbook en Select character set for the CSV Import|Export.
|
||||||
which currency symbol or name should be used in egroupware. preferences en Currency symbol or name.
|
which currency symbol or name should be used in egroupware. preferences en Currency symbol or name.
|
||||||
|
Loading…
Reference in New Issue
Block a user