40 lines
901 B
JavaScript
40 lines
901 B
JavaScript
import ngModule from '../module';
|
|
|
|
export default class Controller {
|
|
constructor($, $state) {
|
|
this.$state = $state;
|
|
Object.assign(this, {
|
|
$,
|
|
selectedWorker: null,
|
|
});
|
|
}
|
|
|
|
preview(event, worker) {
|
|
if (event.defaultPrevented) return;
|
|
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
|
|
this.selectedWorker = worker;
|
|
this.$.preview.show();
|
|
}
|
|
|
|
goToTimeControl(event, workerId) {
|
|
if (event.defaultPrevented) return;
|
|
|
|
event.preventDefault();
|
|
event.stopPropagation();
|
|
this.$state.go('worker.card.timeControl', {id: workerId}, {absolute: true});
|
|
}
|
|
|
|
onMoreChange(callback) {
|
|
callback.call(this);
|
|
}
|
|
}
|
|
Controller.$inject = ['$scope', '$state'];
|
|
|
|
ngModule.component('vnWorkerIndex', {
|
|
template: require('./index.html'),
|
|
controller: Controller
|
|
});
|