MCPcopy
hub / github.com/e-oj/Magic-Grid / initStyles

Method initStyles

src/index.js:66–85  ·  view source on GitHub ↗

* Initializes styles * * @private

()

Source from the content-addressed store, hash-verified

64 * @private
65 */
66 initStyles () {
67 if (!this.ready()) return;
68
69 this.container.style.position = "relative";
70 const items = this.items();
71
72 for (let i = 0; i < items.length; i++) {
73 if (this.styledItems.has(items[i])) continue;
74
75 let style = items[i].style;
76
77 style.position = "absolute";
78
79 if (this.animate) {
80 style.transition = `${this.useTransform ? "transform" : "top, left"} 0.2s ease`;
81 }
82
83 this.styledItems.add(items[i]);
84 }
85 }
86
87 /**
88 * Gets a collection of all items in a grid.

Callers 1

positionItemsMethod · 0.95

Calls 2

readyMethod · 0.95
itemsMethod · 0.95

Tested by

no test coverage detected