2019-01-21 10:45:53 +00:00
|
|
|
import ngModule from '../../module';
|
|
|
|
import Component from '../../lib/component';
|
|
|
|
|
|
|
|
class Controller extends Component {
|
2019-10-04 10:20:49 +00:00
|
|
|
onClick(event, item) {
|
2019-10-01 09:15:15 +00:00
|
|
|
if (event.defaultPrevented || !item.sons) return;
|
|
|
|
event.preventDefault();
|
2019-01-21 10:45:53 +00:00
|
|
|
this.treeview.onToggle(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-02 07:54:52 +00:00
|
|
|
ngModule.component('vnTreeviewChilds', {
|
|
|
|
template: require('./childs.html'),
|
2019-01-21 10:45:53 +00:00
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
2019-03-12 14:04:09 +00:00
|
|
|
items: '<',
|
2019-10-02 12:12:17 +00:00
|
|
|
parent: '<?'
|
2019-10-01 13:09:55 +00:00
|
|
|
},
|
2019-01-21 10:45:53 +00:00
|
|
|
require: {
|
|
|
|
treeview: '^vnTreeview'
|
|
|
|
}
|
|
|
|
});
|