MCPcopy
hub / github.com/rikschennink/fitty / init

Function init

src/fitty.js:166–185  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

164 };
165
166 const init = (f) => {
167 // save some of the original CSS properties before we change them
168 f.originalStyle = {
169 whiteSpace: f.element.style.whiteSpace,
170 display: f.element.style.display,
171 fontSize: f.element.style.fontSize,
172 };
173
174 // should we observe DOM mutations
175 observeMutations(f);
176
177 // this is a new fitty so we need to validate if it's styles are in order
178 f.newbie = true;
179
180 // because it's a new fitty it should also be dirty, we want it to redraw on the first loop
181 f.dirty = true;
182
183 // we want to be able to update this fitty
184 fitties.push(f);
185 };
186
187 const destroy = (f) => () => {
188 // remove from fitties array

Callers 1

fittyCreateFunction · 0.85

Calls 1

observeMutationsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…