add: getText
compatibility.
add: `AssetSelector` and `TemplateSelector`. add: `popup-selector` style class. add: `ui.resolvePopup` function. add: `switch` in checkbox. add: `GridColumn.filterTemplate` supports. add: add `action` callback in `createIcon`. change: replace `setTimeout(..., 0)` with `requestAnimationFrame`. change: Popup result structure adjustment ({ result: any, popup: Popup }). change: complete add work order flow. change: reduce Popup title height. fix: Grid column sort in number.
This commit is contained in:
@ -24,15 +24,20 @@ export function changeIcon(svg, type, id) {
|
||||
return svg;
|
||||
}
|
||||
|
||||
export function createIcon(type, id, style) {
|
||||
export function createIcon(type, id, style, action) {
|
||||
const svg = document.createElementNS(svgns, 'svg');
|
||||
svg.classList.add('ui-icon');
|
||||
svg.appendChild(createUse(type, id));
|
||||
if (style != null) {
|
||||
if (typeof style === 'function') {
|
||||
style(svg);
|
||||
} else if (style != null) {
|
||||
for (let css of Object.entries(style)) {
|
||||
svg.style.setProperty(css[0], css[1]);
|
||||
}
|
||||
}
|
||||
if (typeof action === 'function') {
|
||||
svg.addEventListener('click', action);
|
||||
}
|
||||
return svg;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user