diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-06 22:47:33 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-06 22:47:33 +1300 |
commit | 06c4ae96db8805cb3468a3028d652a1f8a0823b9 (patch) | |
tree | 837ca1f3382fd67fd1c2a12b56d3f553e6741242 /web/app/view | |
parent | f8bf7ede29f2e063a30721e8ed415a6184646424 (diff) | |
parent | a3641de343252f405df7970c97c72fff3e7405b9 (diff) | |
download | trackermap-web-06c4ae96db8805cb3468a3028d652a1f8a0823b9.tar.gz trackermap-web-06c4ae96db8805cb3468a3028d652a1f8a0823b9.tar.bz2 trackermap-web-06c4ae96db8805cb3468a3028d652a1f8a0823b9.zip |
Merge pull request #349 from Abyss777/fix_notifications2
Fix notifications
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/Notifications.js | 6 | ||||
-rw-r--r-- | web/app/view/NotificationsController.js | 31 |
2 files changed, 7 insertions, 30 deletions
diff --git a/web/app/view/Notifications.js b/web/app/view/Notifications.js index 795cf326..419d9616 100644 --- a/web/app/view/Notifications.js +++ b/web/app/view/Notifications.js @@ -24,7 +24,7 @@ Ext.define('Traccar.view.Notifications', { ], controller: 'notificationsController', - store: 'AllNotifications', + store: 'Notifications', selModel: { selType: 'cellmodel' @@ -48,14 +48,14 @@ Ext.define('Traccar.view.Notifications', { } }, { text: Strings.notificationWeb, - dataIndex: 'attributes.web', + dataIndex: 'web', xtype: 'checkcolumn', listeners: { checkChange: 'onCheckChange' } }, { text: Strings.notificationMail, - dataIndex: 'attributes.mail', + dataIndex: 'mail', xtype: 'checkcolumn', listeners: { checkChange: 'onCheckChange' diff --git a/web/app/view/NotificationsController.js b/web/app/view/NotificationsController.js index b920c181..4c83b145 100644 --- a/web/app/view/NotificationsController.js +++ b/web/app/view/NotificationsController.js @@ -24,42 +24,19 @@ Ext.define('Traccar.view.NotificationsController', { ], init: function () { - this.userId = this.getView().user.getId(); this.getView().getStore().load({ - scope: this, - callback: function (records, operation, success) { - Ext.create('Traccar.store.Notifications').load({ - params: { - userId: this.userId - }, - scope: this, - callback: function (records, operation, success) { - if (success) { - this.getView().getStore().loadData(records); - } - } - }); + params: { + userId: this.getView().user.getId() } }); }, onCheckChange: function (column, rowIndex, checked, eOpts) { - var record, attributes = {}; - record = this.getView().getStore().getAt(rowIndex); - if (record.get('attributes.web')) { - attributes.web = 'true'; - } - if (record.get('attributes.mail')) { - attributes.mail = 'true'; - } + var record = this.getView().getStore().getAt(rowIndex); Ext.Ajax.request({ scope: this, url: 'api/users/notifications', - jsonData: { - userId: this.userId, - type: record.get('type'), - attributes: attributes - }, + jsonData: record.data, callback: function (options, success, response) { if (!success) { Traccar.app.showError(response); |