mirror of
https://github.com/edward-shen/MMM-pages.git
synced 2025-04-19 03:38:19 -07:00
Apply suggestions from code review
Co-authored-by: Edward Shen <eddie22099@gmail.com>
This commit is contained in:
parent
fe72525d8c
commit
f89c4d9e5c
1 changed files with 6 additions and 6 deletions
12
MMM-pages.js
12
MMM-pages.js
|
@ -14,7 +14,7 @@ Module.register('MMM-pages', {
|
||||||
fixed: ['MMM-page-indicator'],
|
fixed: ['MMM-page-indicator'],
|
||||||
animationTime: 1000,
|
animationTime: 1000,
|
||||||
rotationTime: 0,
|
rotationTime: 0,
|
||||||
rotationFirstpage:0,
|
rotationFirstpage: 0,
|
||||||
rotationDelay: 10000
|
rotationDelay: 10000
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ Module.register('MMM-pages', {
|
||||||
// Disable rotation if an invalid input is given
|
// Disable rotation if an invalid input is given
|
||||||
this.config.rotationTime = Math.max(this.config.rotationTime, 0);
|
this.config.rotationTime = Math.max(this.config.rotationTime, 0);
|
||||||
this.config.rotationDelay = Math.max(this.config.rotationDelay, 0);
|
this.config.rotationDelay = Math.max(this.config.rotationDelay, 0);
|
||||||
this.config.rotationFirstpage = Math.max(this.config.rotationFirstpage, 0);
|
this.config.rotationFirstPage = Math.max(this.config.rotationFirstPage, 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -214,7 +214,7 @@ Module.register('MMM-pages', {
|
||||||
self.updatePages();
|
self.updatePages();
|
||||||
}, self.config.rotationTime);
|
}, self.config.rotationTime);
|
||||||
}, delay);
|
}, delay);
|
||||||
}if (this.config.rotationFirstpage > 0) {
|
} else if (this.config.rotationFirstPage > 0) {
|
||||||
// This timer is the auto rotate function.
|
// This timer is the auto rotate function.
|
||||||
clearInterval(this.timer);
|
clearInterval(this.timer);
|
||||||
// This is delay timer after manually updating.
|
// This is delay timer after manually updating.
|
||||||
|
@ -224,10 +224,10 @@ Module.register('MMM-pages', {
|
||||||
this.delayTimer = setTimeout(() => {
|
this.delayTimer = setTimeout(() => {
|
||||||
self.timer = setInterval(() => {
|
self.timer = setInterval(() => {
|
||||||
self.sendNotification('PAGE_CHANGED', 0);
|
self.sendNotification('PAGE_CHANGED', 0);
|
||||||
self.changePageBy(-this.curPage);
|
self.curPage = 0;
|
||||||
self.updatePages();
|
self.updatePages();
|
||||||
}, self.config.rotationFirstpage);
|
}, self.config.rotationFirstPage);
|
||||||
}, delay);
|
}, delay);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue