salix/modules/route/front/index/index.js

34 lines
839 B
JavaScript

import ngModule from '../module';
export default class Controller {
constructor($scope, vnToken) {
this.$ = $scope;
this.accessToken = vnToken.token;
}
showWorkerDescriptor(event, workerFk) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopPropagation();
this.selectedWorker = workerFk;
this.$.workerDescriptor.parent = event.target;
this.$.workerDescriptor.show();
}
preview(event, route) {
if (event.defaultPrevented) return;
event.preventDefault();
event.stopPropagation();
this.routeSelected = route;
this.$.summary.show();
}
}
Controller.$inject = ['$scope', 'vnToken'];
ngModule.component('vnRouteIndex', {
template: require('./index.html'),
controller: Controller
});