Skip to content

Commit

Permalink
Added DOM_OBJECTS_UPDATED notification each time the DOM is re-render…
Browse files Browse the repository at this point in the history
…ed. Ensures the module can know when the DOM is available for interaction. Fixes MagicMirrorOrg#3534.
  • Loading branch information
ryan-d-williams committed Sep 13, 2024
1 parent 53fc814 commit 9fcbaa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Thanks to: @btoconnor, @bugsounet, @JasonStieber, @khassel, @kleinmantara and @W
- [calendar] Added config option "showEndsOnlyWithDuration" for default calendar
- [compliments] Added `specialDayUnique` config option, defaults to `false` (#3465)
- [weather] Provider weathergov: Use `precipitationLast3Hours` if `precipitationLastHour` is `null` (#3124)
- [core] Added `DOM_OBJECTS_UPDATED` notification each time the DOM is re-rendered via `updateDom` (#3534)

### Removed

Expand Down
7 changes: 6 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,12 @@ const MM = (function () {
}

// Further implementation is done in the private method.
updateDom(module, updateOptions);
let update_promise = updateDom(module, updateOptions);

// Once the update is complete and rendered, send a notification to the module that the DOM has been updated
update_promise.then(function () {
sendNotification("DOM_OBJECTS_UPDATED", null, null, module);
});
},

/**
Expand Down

0 comments on commit 9fcbaa7

Please sign in to comment.