From 394f93f39c0fa850d9373562807528906e625e31 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 9 Aug 2018 11:42:48 -0700 Subject: [PATCH] Fix SortOrder --- scripts/modules/appUi.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/modules/appUi.js b/scripts/modules/appUi.js index 0657b57826..6d2986768a 100644 --- a/scripts/modules/appUi.js +++ b/scripts/modules/appUi.js @@ -87,12 +87,18 @@ function AppUi(properties) { defaultButton('activeButton', 'a.svg'); defaultButton('normalMessagesButton', 'i-msg.svg'); defaultButton('activeMessagesButton', 'a-msg.svg'); - that.button = that.tablet.addButton({ + var buttonOptions = { icon: that.normalButton, activeIcon: that.activeButton, - text: that.buttonName, - sortOrder: that.sortOrder || undefined - }); + text: that.buttonName + }; + // `TabletScriptingInterface` looks for the presence of a `sortOrder` key. + // What it SHOULD do is look to see if the value inside that key is defined. + // To get around the current code, we do this instead. + if (that.sortOrder) { + buttonOptions.sortOrder = that.sortOrder; + } + that.button = that.tablet.addButton(buttonOptions); that.ignore = function ignore() { }; // Handlers