mirror of
https://github.com/edward-shen/MMM-pages.git
synced 2024-11-21 09:44:29 -08:00
update readme, changed initial notification to NEW_PAGE
This commit is contained in:
parent
87f6b1eba1
commit
8e57458b72
2 changed files with 13 additions and 2 deletions
|
@ -99,7 +99,7 @@ Module.register('MMM-pages', {
|
|||
Log.log('[Pages]: received that all objects are created;'
|
||||
+ 'will now hide things!');
|
||||
this.sendNotification('MAX_PAGES_CHANGED', this.config.modules.length);
|
||||
this.sendNotification('PAGE_CHANGED', this.curPage);
|
||||
this.sendNotification('NEW_PAGE', this.curPage);
|
||||
this.animatePageChange();
|
||||
this.resetTimerWithDelay(0);
|
||||
break;
|
||||
|
|
13
readme.md
13
readme.md
|
@ -65,7 +65,7 @@ For the `module` configuration option, the first element of the outer array
|
|||
should consist of elements that should be on the first page. The second element
|
||||
should consist of elements that should be on the second page, and so forth.
|
||||
|
||||
## Regarding notifications
|
||||
## Notifications
|
||||
|
||||
This module responds to the notification `PAGE_CHANGED`. The payload should be
|
||||
an `integer`. Note that this has strict error checking, so `"3"` will not work,
|
||||
|
@ -106,6 +106,17 @@ you can send a `RESUME_ROTATION` event to resume it.
|
|||
|
||||
If you want to return to the home page, simply send a `HOME_PAGE` notification.
|
||||
|
||||
### Initialization
|
||||
|
||||
_This section provides documentation on what notifications the module sends on
|
||||
startup. This section isn't necessary to read for most users._
|
||||
|
||||
MMM-pages doesn't activate until we receive the `DOM_OBJECTS_CREATED`
|
||||
notification, as that notification ensures all modules have been loaded. On this
|
||||
notification, we send two notifications out, `MAX_PAGES_CHANGED` and `NEW_PAGE`,
|
||||
so other modules that would like to keep synchronized of the starting page and
|
||||
max pages have a way to determine which page to start on.
|
||||
|
||||
## FAQ
|
||||
|
||||
- Help! My module is (above/below) another module in the same region but I want
|
||||
|
|
Loading…
Reference in a new issue