diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-20 22:37:34 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-20 22:37:34 +1200 |
commit | dc76207257da485eeb4887202335c24e46d90263 (patch) | |
tree | 2ab4b0384c989a34e6b5d62b194bb3663ecf8cb4 /web/app/view | |
parent | 412bb3fe1c9fe9301c18c5c849e1432b58647055 (diff) | |
download | trackermap-server-dc76207257da485eeb4887202335c24e46d90263.tar.gz trackermap-server-dc76207257da485eeb4887202335c24e46d90263.tar.bz2 trackermap-server-dc76207257da485eeb4887202335c24e46d90263.zip |
Add report controller events
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/map/Map.js | 6 | ||||
-rw-r--r-- | web/app/view/map/MapController.js | 40 | ||||
-rw-r--r-- | web/app/view/report/ReportController.js | 4 |
3 files changed, 50 insertions, 0 deletions
diff --git a/web/app/view/map/Map.js b/web/app/view/map/Map.js index 38ec00447..a43df40e1 100644 --- a/web/app/view/map/Map.js +++ b/web/app/view/map/Map.js @@ -18,6 +18,12 @@ Ext.define('Traccar.view.map.Map', { extend: 'Ext.form.Panel', xtype: 'map-view', + requires: [ + 'Traccar.view.map.MapController' + ], + + controller: 'map', + title: strings.map_title, layout: 'fit', diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js new file mode 100644 index 000000000..d02d454d6 --- /dev/null +++ b/web/app/view/map/MapController.js @@ -0,0 +1,40 @@ +/* + * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.view.map.MapController', { + extend: 'Ext.app.ViewController', + alias: 'controller.map', + + config: { + listen: { + controller: { + '*': { + reportShow: 'reportShow', + reportClear: 'reportClear' + } + } + } + }, + + reportShow: function() { + console.log('reportShow'); + }, + + reportClear: function() { + console.log('reportClear'); + } + +}); diff --git a/web/app/view/report/ReportController.js b/web/app/view/report/ReportController.js index 81da6fb83..df194c7f1 100644 --- a/web/app/view/report/ReportController.js +++ b/web/app/view/report/ReportController.js @@ -43,10 +43,14 @@ Ext.define('Traccar.view.report.ReportController', { to: to } }); + + this.fireEvent("reportShow"); }, onClearClick: function() { Ext.getStore('Positions').removeAll(); + + this.fireEvent("reportClear"); } }); |