Skip to content
Snippets Groups Projects
Commit 0c871285 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Add refresh button WIP

parent d5afb32f
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,16 @@ class PersonSelect extends VPULitElementJQuery { ...@@ -63,6 +63,16 @@ class PersonSelect extends VPULitElementJQuery {
}, 500); }, 500);
}); });
that.$('#reload-button').click(() => {
// fire a change event
that.dispatchEvent(new CustomEvent('change', {
detail: {
value: that.value,
},
bubbles: true
}));
});
// try an init when user-interface is loaded // try an init when user-interface is loaded
that.initJSONLD(); that.initJSONLD();
}); });
...@@ -252,6 +262,12 @@ class PersonSelect extends VPULitElementJQuery { ...@@ -252,6 +262,12 @@ class PersonSelect extends VPULitElementJQuery {
return css` return css`
${commonStyles.getThemeCSS()} ${commonStyles.getThemeCSS()}
${commonStyles.getGeneralCSS()} ${commonStyles.getGeneralCSS()}
${commonStyles.getButtonCSS()}
${commonStyles.getFormAddonsCSS()}
.select2-control.control {
width: 100%;
}
.select2-dropdown { .select2-dropdown {
border-radius: var(--vpu-border-radius); border-radius: var(--vpu-border-radius);
...@@ -264,6 +280,20 @@ class PersonSelect extends VPULitElementJQuery { ...@@ -264,6 +280,20 @@ class PersonSelect extends VPULitElementJQuery {
.select2-container--default .select2-selection--single .select2-selection__rendered { .select2-container--default .select2-selection--single .select2-selection__rendered {
color: inherit; color: inherit;
} }
.field .button.control {
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #aaa;
-moz-border-radius-topright: var(--vpu-border-radius);
-moz-border-radius-bottomright: var(--vpu-border-radius);
line-height: 100%;
}
.field .button.control vpu-icon {
top: 0;
}
`; `;
} }
...@@ -279,8 +309,15 @@ class PersonSelect extends VPULitElementJQuery { ...@@ -279,8 +309,15 @@ class PersonSelect extends VPULitElementJQuery {
</style> </style>
<div class="select"> <div class="select">
<!-- https://select2.org--> <div class="field has-addons">
<select id="${this.selectId}" name="person" class="select" ?disabled=${!this.active}>${!this.active ? html`<option value="" disabled selected>${ i18n.t('person-select.login-required')}</option>` : ''}</select> <div class="select2-control control">
<!-- https://select2.org-->
<select id="${this.selectId}" name="person" class="select" ?disabled=${!this.active}>${!this.active ? html`<option value="" disabled selected>${ i18n.t('person-select.login-required')}</option>` : ''}</select>
</div>
<a class="control button" id="reload-button" style="display: none">
<vpu-icon name="reload"></vpu-icon>
</a>
</div>
<div id="person-select-dropdown"></div> <div id="person-select-dropdown"></div>
</div> </div>
`; `;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment