salix/modules/worker/front/index/index.js

38 lines
808 B
JavaScript
Raw Normal View History

2019-01-28 15:24:45 +00:00
import ngModule from '../module';
export default class Controller {
2019-03-12 14:04:09 +00:00
constructor($, $state) {
this.$state = $state;
2019-01-28 15:24:45 +00:00
Object.assign(this, {
$,
2019-01-29 15:37:59 +00:00
selectedWorker: null,
2019-01-28 15:24:45 +00:00
});
}
2019-03-11 07:00:49 +00:00
onSearch(params) {
if (params)
this.$.model.applyFilter(null, params);
else
this.$.model.clear();
2019-01-28 15:24:45 +00:00
}
preview(event, worker) {
if (event.defaultPrevented) return;
event.preventDefault();
2019-11-10 10:08:44 +00:00
event.stopPropagation();
2019-01-28 15:24:45 +00:00
this.selectedWorker = worker;
this.$.preview.show();
}
2019-03-12 14:04:09 +00:00
onMoreChange(callback) {
callback.call(this);
}
2019-01-28 15:24:45 +00:00
}
2019-03-12 14:04:09 +00:00
Controller.$inject = ['$scope', '$state'];
2019-01-28 15:24:45 +00:00
ngModule.component('vnWorkerIndex', {
template: require('./index.html'),
controller: Controller
});