MCPcopy Create free account
hub / github.com/Maps4HTML/MapML.js / attributeChangedCallback

Method attributeChangedCallback

src/map-style.js:15–25  ·  view source on GitHub ↗
(name, oldValue, newValue)

Source from the content-addressed store, hash-verified

13 this.setAttribute('media', val);
14 }
15 async attributeChangedCallback(name, oldValue, newValue) {
16 if (this.#hasConnected /* jshint ignore:line */) {
17 switch (name) {
18 case 'media':
19 if (oldValue !== newValue) {
20 await this._registerMediaQuery(newValue);
21 }
22 break;
23 }
24 }
25 }
26 async _registerMediaQuery(mq) {
27 if (!this._changeHandler) {
28 // Define and bind the change handler once

Callers

nothing calls this directly

Calls 1

_registerMediaQueryMethod · 0.95

Tested by

no test coverage detected