mirror of
https://github.com/edward-shen/MMM-pages.git
synced 2024-11-24 19:24:30 -08:00
Add null handling for negative null. Closes #22.
This commit is contained in:
parent
2d7803e4e5
commit
9684949a1d
1 changed files with 4 additions and 2 deletions
|
@ -41,7 +41,7 @@ Module.register('MMM-pages', {
|
||||||
*/
|
*/
|
||||||
start: function() {
|
start: function() {
|
||||||
this.curPage = 0;
|
this.curPage = 0;
|
||||||
|
|
||||||
// Compatibility
|
// Compatibility
|
||||||
if (this.config.excludes.length) {
|
if (this.config.excludes.length) {
|
||||||
Log.warn(`[Pages]: The config option "excludes" is deprecated. Please use "fixed" instead.`);
|
Log.warn(`[Pages]: The config option "excludes" is deprecated. Please use "fixed" instead.`);
|
||||||
|
@ -79,7 +79,9 @@ Module.register('MMM-pages', {
|
||||||
break;
|
break;
|
||||||
case 'PAGE_DECREMENT':
|
case 'PAGE_DECREMENT':
|
||||||
Log.log('[Pages]: received a notification to decrement pages!');
|
Log.log('[Pages]: received a notification to decrement pages!');
|
||||||
this.changePageBy(-payload, -1);
|
// We can't just pass in -payload for situations where payload is null
|
||||||
|
// JS will coerce -payload to -0.
|
||||||
|
this.changePageBy(payload ? -payload : payload, -1);
|
||||||
this.updatePages();
|
this.updatePages();
|
||||||
break;
|
break;
|
||||||
case 'DOM_OBJECTS_CREATED':
|
case 'DOM_OBJECTS_CREATED':
|
||||||
|
|
Loading…
Reference in a new issue