reverted back to old function declaration

This commit is contained in:
Edward Shen 2018-05-06 09:33:33 -04:00
parent 1425b70ad6
commit 6c15c9edaf
No known key found for this signature in database
GPG key ID: 4E887A42793D0433

View file

@ -1,5 +1,8 @@
Module.register('MMM-pages', { Module.register('MMM-pages', {
// We require the older style of function declaration for compatability
// reasons.
/** /**
* By default, we have don't psuedo-paginate any modules. We also exclude * By default, we have don't psuedo-paginate any modules. We also exclude
* the page indicator by default, in case people actually want to use the * the page indicator by default, in case people actually want to use the
@ -16,7 +19,7 @@ Module.register('MMM-pages', {
/** /**
* Apply any styles, if we have any. * Apply any styles, if we have any.
*/ */
getStyles() { getStyles: function() {
return ['pages.css']; return ['pages.css'];
}, },
@ -26,7 +29,7 @@ Module.register('MMM-pages', {
* @param {number} x The dividend * @param {number} x The dividend
* @param {number} n The divisor * @param {number} n The divisor
*/ */
mod(x, n) { mod: function(x, n) {
return ((x % n) + n) % n; return ((x % n) + n) % n;
}, },
@ -34,7 +37,7 @@ Module.register('MMM-pages', {
* Pseudo-constructor for our module. Makes sure that values aren't negative, * Pseudo-constructor for our module. Makes sure that values aren't negative,
* and sets the default current page to 0. * and sets the default current page to 0.
*/ */
start() { start: function() {
this.curPage = 0; this.curPage = 0;
// Disable rotation if an invalid input is given // Disable rotation if an invalid input is given
@ -51,7 +54,7 @@ Module.register('MMM-pages', {
* @param {string} notification the notification ID * @param {string} notification the notification ID
* @param {number} payload the page to change to * @param {number} payload the page to change to
*/ */
notificationReceived(notification, payload) { notificationReceived: function(notification, payload) {
switch (notification) { switch (notification) {
case 'PAGE_CHANGED': case 'PAGE_CHANGED':
Log.log(`${this.name} recieved a notification` Log.log(`${this.name} recieved a notification`
@ -91,7 +94,7 @@ Module.register('MMM-pages', {
* elements. * elements.
* @param {boolean} manuallyCalled whether or not to add in an extended delay. * @param {boolean} manuallyCalled whether or not to add in an extended delay.
*/ */
updatePages(manuallyCalled) { updatePages: function(manuallyCalled) {
if (this.config.modules.length !== 0) { if (this.config.modules.length !== 0) {
// We need to use self because upstream uses an older electron and thus // We need to use self because upstream uses an older electron and thus
// older version of node // older version of node