mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
bug fixes
This commit is contained in:
parent
b167ae5696
commit
61aa586189
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
|
|
@ -9,5 +9,5 @@ jobs:
|
|||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.'
|
||||
issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
|
||||
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
/**
|
||||
* Notification type.
|
||||
*
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export const EnumNotifyType = Object.freeze({
|
||||
BINARY: 0,
|
||||
INFO: 1,
|
||||
WARNING: 2,
|
||||
ERROR: 3,
|
||||
FATAL: 4
|
||||
});
|
||||
|
|
@ -1180,6 +1180,17 @@ export class Form
|
|||
|
||||
const redirect = form.getFormElement().getAttribute('data-redirect');
|
||||
|
||||
if (form.getMethod() === 'GET_REDIRECT') {
|
||||
let url = form.getAction();
|
||||
for (const pair of data) {
|
||||
url += '&' + pair[0] + '=' + pair[1];
|
||||
}
|
||||
|
||||
window.location.href = url;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
request.setData(data);
|
||||
request.setType(RequestType.FORM_DATA); // @todo consider to allow different request type
|
||||
request.setUri(action !== null ? action : form.getAction());
|
||||
|
|
|
|||
|
|
@ -31,13 +31,10 @@ export class SmartTextInput
|
|||
this.inputComponent = e;
|
||||
|
||||
this.inputField = this.inputComponent.getElementsByClassName('input-div')[0];
|
||||
// @todo Implement. Then find all data-tpl-value and data-tpl-text which are the elements to fill
|
||||
this.dataContainer = this.inputField.getAttribute('data-container') === ''
|
||||
? this.inputComponent
|
||||
: this.inputField.closest(this.inputField.getAttribute('data-container'));
|
||||
this.dataList = this.inputComponent.getElementsByClassName('input-datalist')[0];
|
||||
this.dataListBody = this.inputComponent.getElementsByClassName('input-datalist-body')[0];
|
||||
this.dataTpl = document.getElementsByClassName('input-data-tpl')[0];
|
||||
this.elementContainer = this.dataTpl.hasAttribute('data-container') ? this.dataTpl.getAttribute('data-container') : '';
|
||||
this.src = this.inputComponent.getAttribute('data-src');
|
||||
|
||||
const self = this;
|
||||
|
|
@ -69,8 +66,13 @@ export class SmartTextInput
|
|||
|
||||
if (length > 0 && self.inputField.getAttribute('data-value') !== '') {
|
||||
let isValid = false;
|
||||
|
||||
for (let i = 0; i < length; ++i) {
|
||||
if (list[i].textContent === self.inputField.textContent) {
|
||||
const textElements = list[i].hasAttribute('data-tpl-text')
|
||||
? [list[i]]
|
||||
: list[i].querySelectorAll('[data-tpl-text]');
|
||||
|
||||
if (Array.from(textElements).map(e => e.textContent).join(' ').trim() === self.inputField.textContent) {
|
||||
isValid = true;
|
||||
|
||||
break;
|
||||
|
|
@ -128,13 +130,13 @@ export class SmartTextInput
|
|||
}
|
||||
} else if (e.code === 'Enter' || e.code === 'Tab') {
|
||||
self.clearDataListSelection(self);
|
||||
self.addToResultList(self, document.activeElement);
|
||||
self.addToResultList(self, self.elementContainer === '' ? document.activeElement : document.activeElement.closest('.' + self.elementContainer));
|
||||
}
|
||||
});
|
||||
|
||||
this.dataList.addEventListener('click', function (e) {
|
||||
self.clearDataListSelection(self);
|
||||
self.addToResultList(self, e.target);
|
||||
self.addToResultList(self, self.elementContainer === '' ? e.target : e.target.closest('.' + self.elementContainer));
|
||||
self.dataList.classList.add('vh');
|
||||
});
|
||||
};
|
||||
|
|
@ -291,8 +293,11 @@ export class SmartTextInput
|
|||
self.inputField.value = jsOMS.getArray(self.inputField.getAttribute('data-value'), data);
|
||||
}
|
||||
|
||||
self.inputField.setAttribute('data-value', e.getAttribute('data-value'));
|
||||
self.inputField.textContent = e.textContent;
|
||||
const value = e.hasAttribute('data-value') ? e.getAttribute('data-value') : e.querySelector('[data-value]').getAttribute('data-value');
|
||||
const textElements = e.hasAttribute('data-tpl-text') ? [e] : e.querySelectorAll('[data-tpl-text]');
|
||||
|
||||
self.inputField.setAttribute('data-value', value);
|
||||
self.inputField.textContent = Array.from(textElements).map(e => e.textContent).join(' ').trim();
|
||||
|
||||
self.inputField.focus();
|
||||
self.dataList.classList.add('vh');
|
||||
|
|
|
|||
|
|
@ -37,12 +37,16 @@ export class MouseManager
|
|||
*/
|
||||
add (element, type, button, callback, exact)
|
||||
{
|
||||
if (typeof this.elements[element] === 'undefined') {
|
||||
this.elements[element] = [];
|
||||
}
|
||||
const elements = document.querySelectorAll(element);
|
||||
const length = elements.length;
|
||||
for (let i = 0; i < length; ++i) {
|
||||
if (typeof this.elements[elements[i].id] === 'undefined') {
|
||||
this.elements[elements[i].id] = [];
|
||||
}
|
||||
|
||||
this.bind(element, type);
|
||||
this.elements[element].push({ callback: callback, type: type, button: button, exact: exact });
|
||||
this.bind(elements[i].id, type);
|
||||
this.elements[elements[i].id].push({ callback: callback, type: type, button: button, exact: exact });
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user