+ updateDOM(prevNode: MediaNode, dom: HTMLElement): boolean {
+ if (prevNode.__tag !== this.__tag) {
+ return true;
+ }
+
+ if (JSON.stringify(prevNode.__sources) !== JSON.stringify(this.__sources)) {
+ return true;
+ }
+
+ if (JSON.stringify(prevNode.__attributes) !== JSON.stringify(this.__attributes)) {
+ return true;
+ }
+
+ const mediaEl = dom.firstElementChild as HTMLElement;
+
+ if (prevNode.__id !== this.__id) {
+ setOrRemoveAttribute(mediaEl, 'id', this.__id);
+ }
+
+ if (prevNode.__alignment !== this.__alignment) {
+ if (prevNode.__alignment) {
+ dom.classList.remove(`align-${prevNode.__alignment}`);
+ mediaEl.classList.remove(`align-${prevNode.__alignment}`);
+ }
+ if (this.__alignment) {
+ dom.classList.add(`align-${this.__alignment}`);
+ mediaEl.classList.add(`align-${this.__alignment}`);
+ }
+ }
+
+ return false;