Closed mutec closed 1 week ago
The element is available for use through document.createElement("woltlab-core-notice")
just like any other element?
Okay, I'll check my IDE's cache. I didn't find it in global.d.ts
as Type or Interface.
You are correct. I was under the impression that it had been added but I failed to check if beforehand.
Thanks! :)
Making
WoltlabCoreNoticeElement
available for TypeScript would make it possible to display notices dynamically based on some previously executed code. Example:BarcodeDetector
is availableExecuting the check and showing an error after the user clicked on some buttons would be pretty bad user experience. Creating a notice statically using the template engine produces another unused DOM-element.
This would also be a good way to handle status indicators dynamically like you'd use for a monitoring system without a lot of overhead in 3rdparty code (like checking the set classes, removing them and adding the new status class in case a notice changes from error to success).
It should be possible to attach the notice to the default notice location right before the page's content / after the pagination.