41 lines
988 B
JavaScript
41 lines
988 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();
|
|
}
|
|
|
|
onSearch(params) {
|
|
if (params)
|
|
this.$.model.applyFilter(null, params);
|
|
else
|
|
this.$.model.clear();
|
|
}
|
|
}
|
|
Controller.$inject = ['$scope', 'vnToken'];
|
|
|
|
ngModule.component('vnRouteIndex', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|