salix/front/core/components/treeview/childs.js

23 lines
514 B
JavaScript

import ngModule from '../../module';
import Component from '../../lib/component';
class Controller extends Component {
onClick(event, item) {
if (event.defaultPrevented || !item.sons) return;
event.preventDefault();
this.treeview.onToggle(item);
}
}
ngModule.component('vnTreeviewChilds', {
template: require('./childs.html'),
controller: Controller,
bindings: {
items: '<',
parent: '<?'
},
require: {
treeview: '^vnTreeview'
}
});