From e3bd22de8c3eb892408cedfec85e6bc0594bab32 Mon Sep 17 00:00:00 2001 From: Dhrubomoy Das Gupta Date: Wed, 7 Jun 2017 23:01:14 -0400 Subject: [PATCH] [Autocomplete] Minor refactoring --- .../clock/src/controllers/ClockController.js | 4 ++-- .../res/templates/controls/autocomplete.html | 4 ++-- .../src/controllers/AutocompleteController.js | 21 +++++++++---------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/platform/features/clock/src/controllers/ClockController.js b/platform/features/clock/src/controllers/ClockController.js index 945be23f87..02b32cfc4f 100644 --- a/platform/features/clock/src/controllers/ClockController.js +++ b/platform/features/clock/src/controllers/ClockController.js @@ -48,7 +48,7 @@ define([ function update() { var m = zoneName ? moment.utc(lastTimestamp).tz(zoneName) : moment.utc(lastTimestamp); - self.zoneAbbr = zoneName ? m.zoneAbbr() : "UTC"; + self.zoneAbbr = m.zoneAbbr(); self.textValue = timeFormat && m.format(timeFormat); self.ampmValue = m.format("A"); // Just the AM or PM part } @@ -69,8 +69,8 @@ define([ // If wrong timezone is provided, the UTC will be used zoneName = momentTimezone.tz.names().includes(model.timezone) ? model.timezone : "UTC"; + update(); } - update(); } // Pull in the model (clockFormat and timezone) from the domain object model diff --git a/platform/forms/res/templates/controls/autocomplete.html b/platform/forms/res/templates/controls/autocomplete.html index e64085fa4a..9649088848 100644 --- a/platform/forms/res/templates/controls/autocomplete.html +++ b/platform/forms/res/templates/controls/autocomplete.html @@ -26,12 +26,12 @@ type="text" ng-model="ngModel[field]" ng-change="filterOptions(ngModel[field])" - ng-click="inputClicked($event)" + ng-click="inputClicked()" ng-keydown="keyDown($event)"/>