mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 09:38:48 +02:00
form for dashboard
This commit is contained in:
@@ -14,6 +14,7 @@ class ChoicesElement extends HTMLSelectElement {
|
||||
plugins: this.plugins,
|
||||
wrapperClass: 'ts-wrapper ibo-input-wrapper ibo-input-select-wrapper--with-buttons ibo-input-select-autocomplete-wrapper',
|
||||
controlClass: 'ts-control ibo-input ibo-input-select ibo-input-select-autocomplete',
|
||||
dropdownParent: 'body',
|
||||
render: {
|
||||
dropdown: function (data, escape) {
|
||||
return `<div class="selectize-dropdown"></div>`;
|
||||
|
||||
@@ -41,19 +41,22 @@ class CollectionEntryElement extends HTMLElement {
|
||||
*/
|
||||
updateButtonStates() {
|
||||
|
||||
if(this.previousElementSibling === null) {
|
||||
this.#eBtnMoveUp.setAttribute('disabled', 'disabled');
|
||||
}
|
||||
else{
|
||||
this.#eBtnMoveUp.removeAttribute('disabled');
|
||||
if (this.dataset.allowOrdering) {
|
||||
|
||||
if (this.previousElementSibling === null) {
|
||||
this.#eBtnMoveUp.setAttribute('disabled', 'disabled');
|
||||
} else {
|
||||
this.#eBtnMoveUp.removeAttribute('disabled');
|
||||
}
|
||||
|
||||
if (this.nextElementSibling === null) {
|
||||
this.#eBtnMoveDown.setAttribute('disabled', 'disabled');
|
||||
} else {
|
||||
this.#eBtnMoveDown.removeAttribute('disabled');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(this.nextElementSibling === null) {
|
||||
this.#eBtnMoveDown.setAttribute('disabled', 'disabled');
|
||||
}
|
||||
else{
|
||||
this.#eBtnMoveDown.removeAttribute('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
25
js/forms/custom-elements/turbo_stream_event.js
Normal file
25
js/forms/custom-elements/turbo_stream_event.js
Normal file
@@ -0,0 +1,25 @@
|
||||
class TurboStreamEvent extends HTMLElement {
|
||||
|
||||
// register the custom element
|
||||
static {
|
||||
customElements.define('turbo-stream-event', TurboStreamEvent);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.style.display = 'none';
|
||||
|
||||
const event = new CustomEvent("itop:TurboStreamEvent", {
|
||||
detail: {
|
||||
id: this.getAttribute('id'),
|
||||
block_class: this.dataset.formBlockClass,
|
||||
view_data: this.dataset.viewData,
|
||||
valid: this.dataset.valid,
|
||||
},
|
||||
});
|
||||
|
||||
document.dispatchEvent(event);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user