salix/front/core/components/wday-picker/index.js

25 lines
639 B
JavaScript
Raw Permalink Normal View History

2019-10-23 15:38:35 +00:00
import ngModule from '../../module';
import FormInput from '../form-input';
import './style.scss';
export default class WdayPicker extends FormInput {
constructor($element, $scope, vnWeekDays) {
super($element, $scope);
this.days = vnWeekDays.locales;
2019-10-24 08:17:32 +00:00
this.initTabIndex();
2019-10-23 15:38:35 +00:00
}
2019-11-18 15:31:37 +00:00
toggleDay(index) {
let field = this.field;
if (!field) field = [];
field[index] = !field[index];
this.change(field);
}
2019-10-23 15:38:35 +00:00
}
WdayPicker.$inject = ['$element', '$scope', 'vnWeekDays'];
ngModule.vnComponent('vnWdayPicker', {
template: require('./index.html'),
controller: WdayPicker
});