mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-02 19:39:39 +01:00
Fix placeholder widget
IDs on et2-boxes caused unwanted namespace, Et2Listbox couldn't find its ID before fully initializing
This commit is contained in:
parent
7eaebce7fd
commit
80fbd3cc26
@ -117,9 +117,13 @@ export class Et2Listbox extends RowLimitedMixin(Et2widgetWithSelectMixin(SlMenu)
|
|||||||
|
|
||||||
get value()
|
get value()
|
||||||
{
|
{
|
||||||
let value = this.getAllItems()
|
let value = [];
|
||||||
|
if(this.defaultSlot)
|
||||||
|
{
|
||||||
|
value = this.getAllItems()
|
||||||
.filter((item) => item.checked)
|
.filter((item) => item.checked)
|
||||||
.map((item) => item.value);
|
.map((item) => item.value);
|
||||||
|
}
|
||||||
return this.multiple ? value : value.pop();
|
return this.multiple ? value : value.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,11 +136,10 @@ export class et2_placeholder_select extends et2_inputWidget
|
|||||||
content: {app: '', group: '', entry: {}},
|
content: {app: '', group: '', entry: {}},
|
||||||
sel_options: {app: [], group: []},
|
sel_options: {app: [], group: []},
|
||||||
modifications: {
|
modifications: {
|
||||||
outer_box: {
|
|
||||||
entry: {
|
entry: {
|
||||||
application_list: []
|
application_list: []
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -156,13 +155,13 @@ export class et2_placeholder_select extends et2_inputWidget
|
|||||||
data.content.app = data.sel_options.app[0].value;
|
data.content.app = data.sel_options.app[0].value;
|
||||||
data.content.group = data.sel_options.group[0]?.value;
|
data.content.group = data.sel_options.group[0]?.value;
|
||||||
data.content.entry = {app: data.content.app};
|
data.content.entry = {app: data.content.app};
|
||||||
data.modifications.outer_box.entry.application_list = Object.keys(_data);
|
data.modifications.entry.application_list = Object.keys(_data);
|
||||||
// Remove non-app placeholders (user & general)
|
// Remove non-app placeholders (user & general)
|
||||||
let non_apps = ['user', 'general'];
|
let non_apps = ['user', 'general'];
|
||||||
for(let i = 0; i < non_apps.length; i++)
|
for(let i = 0; i < non_apps.length; i++)
|
||||||
{
|
{
|
||||||
let index = data.modifications.outer_box.entry.application_list.indexOf(non_apps[i]);
|
let index = data.modifications.entry.application_list.indexOf(non_apps[i]);
|
||||||
data.modifications.outer_box.entry.application_list.splice(index, 1);
|
data.modifications.entry.application_list.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// callback for dialog
|
// callback for dialog
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
<!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2.0//EN" "https://www.egroupware.org/etemplate2.0.dtd">
|
<!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2.0//EN" "https://www.egroupware.org/etemplate2.0.dtd">
|
||||||
<overlay>
|
<overlay>
|
||||||
<template id="etemplate.insert_merge_placeholder" template="" lang="" group="0" version="21.1.001">
|
<template id="etemplate.insert_merge_placeholder" template="" lang="" group="0" version="21.1.001">
|
||||||
<et2-vbox id="outer_box">
|
<et2-vbox class="outer_box">
|
||||||
<et2-hbox id="selects">
|
<et2-hbox class="selects">
|
||||||
<et2-vbox>
|
<et2-vbox>
|
||||||
<et2-select id="app"></et2-select>
|
<et2-select id="app"></et2-select>
|
||||||
<et2-select id="group"></et2-select>
|
<et2-select id="group"></et2-select>
|
||||||
@ -13,7 +13,8 @@
|
|||||||
</et2-hbox>
|
</et2-hbox>
|
||||||
<et2-hbox class="preview">
|
<et2-hbox class="preview">
|
||||||
<et2-description id="preview_placeholder"></et2-description>
|
<et2-description id="preview_placeholder"></et2-description>
|
||||||
<et2-button id="insert_placeholder" label="Insert" statustext="Insert placeholder" align="right" image="export"></et2-button>
|
<et2-button id="insert_placeholder" label="Insert" statustext="Insert placeholder" align="right"
|
||||||
|
image="export"></et2-button>
|
||||||
</et2-hbox>
|
</et2-hbox>
|
||||||
<hrule/>
|
<hrule/>
|
||||||
<et2-link-entry id="entry" label="Preview with entry"></et2-link-entry>
|
<et2-link-entry id="entry" label="Preview with entry"></et2-link-entry>
|
||||||
@ -24,13 +25,13 @@
|
|||||||
</et2-vbox>
|
</et2-vbox>
|
||||||
<styles>
|
<styles>
|
||||||
/** Structural stuff **/
|
/** Structural stuff **/
|
||||||
#insert_merge_placeholder #_outer_box > #api\.insert_merge_placeholder_selects {
|
#insert_merge_placeholder ._outer_box > .selects {
|
||||||
flex: 1 1 80%;
|
flex: 1 1 80%;
|
||||||
}
|
}
|
||||||
#insert_merge_placeholder #_outer_box > label.et2_label {
|
#insert_merge_placeholder ._outer_box > label.et2_label {
|
||||||
flex: 0 1 auto;
|
flex: 0 1 auto;
|
||||||
}
|
}
|
||||||
#insert_merge_placeholder #_outer_box .preview {
|
#insert_merge_placeholder ._outer_box .preview {
|
||||||
flex: 1 1 2em;
|
flex: 1 1 2em;
|
||||||
font-size: larger;
|
font-size: larger;
|
||||||
}
|
}
|
||||||
@ -81,7 +82,7 @@
|
|||||||
min-width: 500px;
|
min-width: 500px;
|
||||||
min-height: 250px;
|
min-height: 250px;
|
||||||
}
|
}
|
||||||
#_outer_box option:first-letter {
|
._outer_box option:first-letter {
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
</styles>
|
</styles>
|
||||||
|
Loading…
Reference in New Issue
Block a user