aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/dialog/NotificationController.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-03-22 22:58:18 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-03-22 22:58:18 -0700
commitba9cc86f667486a09edb323402c2d63ada5ea639 (patch)
tree8df80eca54f9dd39664f63365ffcc2ec248fb3df /web/app/view/dialog/NotificationController.js
parent990d485a21c945e7d57b85378650a65f3e79eed3 (diff)
parentf5165c8e897e8d9cf4219d943e2d34b61adb48b5 (diff)
downloadetbsa-traccar-web-ba9cc86f667486a09edb323402c2d63ada5ea639.tar.gz
etbsa-traccar-web-ba9cc86f667486a09edb323402c2d63ada5ea639.tar.bz2
etbsa-traccar-web-ba9cc86f667486a09edb323402c2d63ada5ea639.zip
Merge branch 'master' into modern
Diffstat (limited to 'web/app/view/dialog/NotificationController.js')
-rw-r--r--web/app/view/dialog/NotificationController.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/web/app/view/dialog/NotificationController.js b/web/app/view/dialog/NotificationController.js
index ad65c33..5da669a 100644
--- a/web/app/view/dialog/NotificationController.js
+++ b/web/app/view/dialog/NotificationController.js
@@ -23,5 +23,31 @@ Ext.define('Traccar.view.dialog.NotificationController', {
init: function () {
this.lookupReference('calendarCombo').setHidden(
Traccar.app.getBooleanAttributePreference('ui.disableCalendars'));
+ },
+
+ onTypeChange: function (view, value) {
+ this.lookupReference('alarmsField').setHidden(value !== 'alarm');
+ },
+
+ onAlarmsLoad: function (view) {
+ var attributes, record = view.up('form').getRecord();
+ attributes = record.get('attributes') || {};
+ if (attributes['alarms']) {
+ view.suspendEvents(false);
+ view.setValue(attributes['alarms'].split(','));
+ view.resumeEvents();
+ }
+ },
+
+ onAlarmsChange: function (view, value) {
+ var attributes, record = view.up('window').down('form').getRecord();
+ attributes = record.get('attributes') || {};
+
+ value = value.join();
+ if (attributes['alarms'] !== value) {
+ attributes['alarms'] = value;
+ record.set('attributes', attributes);
+ record.dirty = true;
+ }
}
});