mirror of
https://github.com/edward-shen/MMM-pages.git
synced 2024-11-22 02:04:29 -08:00
reset parameter logic after renaming function
This commit is contained in:
parent
72ebd17d62
commit
3086aa902a
1 changed files with 7 additions and 7 deletions
14
MMM-pages.js
14
MMM-pages.js
|
@ -118,23 +118,23 @@ Module.register('MMM-pages', {
|
||||||
this.sendNotification('PAGE_NUMBER_IS', this.curPage);
|
this.sendNotification('PAGE_NUMBER_IS', this.curPage);
|
||||||
break;
|
break;
|
||||||
case 'PAUSE_ROTATION':
|
case 'PAUSE_ROTATION':
|
||||||
this.setRotation(true);
|
this.setRotation(false);
|
||||||
break;
|
break;
|
||||||
case 'RESUME_ROTATION':
|
case 'RESUME_ROTATION':
|
||||||
this.setRotation(false);
|
this.setRotation(true);
|
||||||
break;
|
break;
|
||||||
case 'HOME_PAGE':
|
case 'HOME_PAGE':
|
||||||
this.notificationReceived('PAGE_CHANGED', this.config.homePage);
|
this.notificationReceived('PAGE_CHANGED', this.config.homePage);
|
||||||
break;
|
break;
|
||||||
case 'SHOW_HIDDEN_PAGE':
|
case 'SHOW_HIDDEN_PAGE':
|
||||||
Log.log(`[Pages]: received a notification to change to the hidden page "${payload}" of type "${typeof payload}"`);
|
Log.log(`[Pages]: received a notification to change to the hidden page "${payload}" of type "${typeof payload}"`);
|
||||||
this.setRotation(true);
|
this.setRotation(false);
|
||||||
this.showHiddenPage(payload);
|
this.showHiddenPage(payload);
|
||||||
break;
|
break;
|
||||||
case 'LEAVE_HIDDEN_PAGE':
|
case 'LEAVE_HIDDEN_PAGE':
|
||||||
Log.log("[Pages]: received a notification to leave the current hidden page ");
|
Log.log("[Pages]: received a notification to leave the current hidden page ");
|
||||||
this.animatePageChange();
|
this.animatePageChange();
|
||||||
this.setRotation(false);
|
this.setRotation(true);
|
||||||
break;
|
break;
|
||||||
default: // Do nothing
|
default: // Do nothing
|
||||||
}
|
}
|
||||||
|
@ -258,19 +258,19 @@ Module.register('MMM-pages', {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pause or resume the page rotation. If the provided isRotating value is
|
* Pause or resume the page rotation. If the provided isRotating value is
|
||||||
* set to false, it will resume the rotation. If the requested
|
* set to true, it will resume the rotation. If the requested
|
||||||
* state (f.e. isRotating === true) equals the current state, print a warning
|
* state (f.e. isRotating === true) equals the current state, print a warning
|
||||||
* and do nothing.
|
* and do nothing.
|
||||||
*
|
*
|
||||||
* @param {boolean} isRotating the parameter, if you want to pause or resume.
|
* @param {boolean} isRotating the parameter, if you want to pause or resume.
|
||||||
*/
|
*/
|
||||||
setRotation: function (isRotating) {
|
setRotation: function (isRotating) {
|
||||||
const stateBaseString = (isRotating) ? "paus" : "resum";
|
const stateBaseString = (isRotating) ? "resum" : "paus";
|
||||||
if (isRotating === this.rotationPaused) {
|
if (isRotating === this.rotationPaused) {
|
||||||
Log.warn(`[Pages]: Was asked to ${stateBaseString}e but rotation is already ${stateBaseString}ed!`);
|
Log.warn(`[Pages]: Was asked to ${stateBaseString}e but rotation is already ${stateBaseString}ed!`);
|
||||||
} else {
|
} else {
|
||||||
Log.log(`[Pages]: ${stateBaseString}ing rotation`);
|
Log.log(`[Pages]: ${stateBaseString}ing rotation`);
|
||||||
if (isRotating) {
|
if (!isRotating) {
|
||||||
clearInterval(this.timer);
|
clearInterval(this.timer);
|
||||||
clearInterval(this.delayTimer);
|
clearInterval(this.delayTimer);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue