MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / addElStyles

Method addElStyles

src/utils.ts:667–682  ·  view source on GitHub ↗
(el: HTMLElement, styles: { [prop: string]: string | string[] })

Source from the content-addressed store, hash-verified

665 // }
666
667 public static addElStyles(el: HTMLElement, styles: { [prop: string]: string | string[] }): void {
668 if (styles instanceof Object) {
669 for (const s in styles) {
670 if (styles.hasOwnProperty(s)) {
671 if (Array.isArray(styles[s])) {
672 // support fallback value
673 (styles[s] as string[]).forEach(val => {
674 el.style[s] = val;
675 });
676 } else {
677 el.style[s] = styles[s];
678 }
679 }
680 }
681 }
682 }
683
684 public static initEvent<T>(e: DragEvent | MouseEvent, info: { type: string; target?: EventTarget }): T {
685 const evt = { type: info.type };

Callers 2

utils-spec.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected