MCPcopy Index your code
hub / github.com/shipshapecode/tether / enable

Method enable

src/js/tether.js:239–256  ·  view source on GitHub ↗
(pos = true)

Source from the content-addressed store, hash-verified

237 }
238
239 enable(pos = true) {
240 const { classes, classPrefix } = this.options;
241 if (!(this.options.addTargetClasses === false)) {
242 addClass(this.target, getClass('enabled', classes, classPrefix));
243 }
244 addClass(this.element, getClass('enabled', classes, classPrefix));
245 this.enabled = true;
246
247 this.scrollParents.forEach((parent) => {
248 if (parent !== this.target.ownerDocument) {
249 parent.addEventListener('scroll', this.position);
250 }
251 });
252
253 if (pos) {
254 this.position();
255 }
256 }
257
258 disable() {
259 const { classes, classPrefix } = this.options;

Callers 4

setOptionsMethod · 0.95
tether.spec.jsFile · 0.80
intro.jsFile · 0.80
drop.jsFile · 0.80

Calls 3

positionMethod · 0.95
addClassFunction · 0.90
getClassFunction · 0.90

Tested by

no test coverage detected