diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-03 20:39:14 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-03 20:39:14 +1300 |
commit | d16121684ecae7646aa87616a64d60978d087bc0 (patch) | |
tree | 69a02f798950bc9ee54e33cdf8ae09fed40168e4 /web/app/view | |
parent | 8782eeec561e490b4262ba8983e69623daaf5845 (diff) | |
download | traccar-server-d16121684ecae7646aa87616a64d60978d087bc0.tar.gz traccar-server-d16121684ecae7646aa87616a64d60978d087bc0.tar.bz2 traccar-server-d16121684ecae7646aa87616a64d60978d087bc0.zip |
Move remaining classes to view
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/DeviceController.js | 6 | ||||
-rw-r--r-- | web/app/view/Map.js | 6 | ||||
-rw-r--r-- | web/app/view/User.js (renamed from web/app/view/user/User.js) | 9 | ||||
-rw-r--r-- | web/app/view/UserController.js (renamed from web/app/view/user/UserController.js) | 16 | ||||
-rw-r--r-- | web/app/view/UserDialog.js (renamed from web/app/view/user/UserDialog.js) | 24 | ||||
-rw-r--r-- | web/app/view/UserDialogController.js (renamed from web/app/view/user/UserDialogController.js) | 7 |
6 files changed, 24 insertions, 44 deletions
diff --git a/web/app/view/DeviceController.js b/web/app/view/DeviceController.js index 64b3b8826..2e2fdb2a6 100644 --- a/web/app/view/DeviceController.js +++ b/web/app/view/DeviceController.js @@ -21,8 +21,8 @@ Ext.define('Traccar.view.DeviceController', { requires: [ 'Traccar.view.CommandDialog', 'Traccar.view.DeviceDialog', - 'Traccar.view.user.UserDialog', - 'Traccar.view.user.User', + 'Traccar.view.UserDialog', + 'Traccar.view.User', 'Traccar.view.LoginController' ], @@ -106,7 +106,7 @@ Ext.define('Traccar.view.DeviceController', { }, onUserClick: function () { - var dialog = Ext.create('Traccar.view.user.UserDialog'); + var dialog = Ext.create('Traccar.view.UserDialog'); dialog.down('form').loadRecord(Traccar.app.getUser()); dialog.show(); }, diff --git a/web/app/view/Map.js b/web/app/view/Map.js index 63be7f666..f7a763b9d 100644 --- a/web/app/view/Map.js +++ b/web/app/view/Map.js @@ -29,7 +29,6 @@ Ext.define('Traccar.view.Map', { listeners: { afterrender: function () { - var user = Traccar.app.getUser(); var server = Traccar.app.getServer(); @@ -67,14 +66,14 @@ Ext.define('Traccar.view.Map', { var zoom = user.get('zoom') || server.get('zoom') || styles.mapDefaultZoom; this.mapView = new ol.View({ - center: ol.proj.fromLonLat([ lon, lat ]), + center: ol.proj.fromLonLat([lon, lat]), zoom: zoom, maxZoom: styles.mapMaxZoom }); this.map = new ol.Map({ target: this.body.dom.id, - layers: [ layer, vectorLayer ], + layers: [layer, vectorLayer], view: this.mapView }); }, @@ -83,5 +82,4 @@ Ext.define('Traccar.view.Map', { this.map.updateSize(); } } - }); diff --git a/web/app/view/user/User.js b/web/app/view/User.js index b5d216aea..807095ebe 100644 --- a/web/app/view/user/User.js +++ b/web/app/view/User.js @@ -14,19 +14,19 @@ * limitations under the License. */ -Ext.define('Traccar.view.user.User', { +Ext.define('Traccar.view.User', { extend: 'Ext.grid.Panel', xtype: 'userView', requires: [ - 'Traccar.view.user.UserController' + 'Traccar.view.UserController' ], - + controller: 'user', store: 'Users', selType: 'rowmodel', - + tbar: [{ text: strings.sharedAdd, handler: 'onAddClick', @@ -57,5 +57,4 @@ Ext.define('Traccar.view.user.User', { { text: strings.userEmail, dataIndex: 'email', flex: 1 }, { text: strings.userAdmin, dataIndex: 'admin', flex: 1 } ] - }); diff --git a/web/app/view/user/UserController.js b/web/app/view/UserController.js index 507fd5a5c..f541914e4 100644 --- a/web/app/view/user/UserController.js +++ b/web/app/view/UserController.js @@ -14,12 +14,12 @@ * limitations under the License. */ -Ext.define('Traccar.view.user.UserController', { +Ext.define('Traccar.view.UserController', { extend: 'Ext.app.ViewController', alias: 'controller.user', - + requires: [ - 'Traccar.view.user.UserDialog' + 'Traccar.view.UserDialog' ], init: function () { @@ -28,18 +28,18 @@ Ext.define('Traccar.view.user.UserController', { onAddClick: function () { var user = Ext.create('Traccar.model.User'); - var dialog = Ext.create('Traccar.view.user.UserDialog'); + var dialog = Ext.create('Traccar.view.UserDialog'); dialog.down('form').loadRecord(user); dialog.show(); }, - + onEditClick: function () { var user = this.getView().getSelectionModel().getSelection()[0]; - var dialog = Ext.create('Traccar.view.user.UserDialog'); + var dialog = Ext.create('Traccar.view.UserDialog'); dialog.down('form').loadRecord(user); dialog.show(); }, - + onRemoveClick: function () { var user = this.getView().getSelectionModel().getSelection()[0]; Ext.Msg.show({ @@ -73,7 +73,7 @@ Ext.define('Traccar.view.user.UserController', { } }).show();*/ }, - + onSelectionChange: function (selected) { var disabled = selected.length > 0; this.lookupReference('userEditButton').setDisabled(disabled); diff --git a/web/app/view/user/UserDialog.js b/web/app/view/UserDialog.js index d1bc68f96..0c5914ce0 100644 --- a/web/app/view/user/UserDialog.js +++ b/web/app/view/UserDialog.js @@ -14,20 +14,17 @@ * limitations under the License. */ -Ext.define('Traccar.view.user.UserDialog', { - extend: 'Ext.window.Window', +Ext.define('Traccar.view.UserDialog', { + extend: 'Traccar.view.BaseEditDialog', requires: [ - 'Traccar.view.user.UserDialogController' + 'Traccar.view.UserDialogController' ], controller: 'userDialog', - - bodyPadding: styles.panelPadding, + title: strings.settingsUser, - resizable: false, - modal: true, - + items: { xtype: 'form', items: [{ @@ -86,14 +83,5 @@ Ext.define('Traccar.view.user.UserDialog', { name: 'zoom', fieldLabel: strings.serverZoom }] - }, - - buttons: [{ - text: strings.sharedSave, - handler: 'onSaveClick' - }, { - text: strings.sharedCancel, - handler: 'onCancelClick' - }] - + } }); diff --git a/web/app/view/user/UserDialogController.js b/web/app/view/UserDialogController.js index 40f938b5c..0bd9d87e3 100644 --- a/web/app/view/user/UserDialogController.js +++ b/web/app/view/UserDialogController.js @@ -14,7 +14,7 @@ * limitations under the License. */ -Ext.define('Traccar.view.user.UserDialogController', { +Ext.define('Traccar.view.UserDialogController', { extend: 'Ext.app.ViewController', alias: 'controller.userDialog', @@ -43,10 +43,5 @@ Ext.define('Traccar.view.user.UserDialogController', { }); } button.up('window').close(); - }, - - onCancelClick: function (button) { - button.up('window').close(); } - }); |