todomvc
Version:
> Helping you select an MV\* framework
21 lines (17 loc) • 400 B
JavaScript
/*global define */
;
define([
'flight/lib/component'
], function (defineComponent) {
function mainSelector() {
this.toggle = function (e, data) {
var toggle = data.all > 0;
this.$node.toggle(toggle);
};
this.after('initialize', function () {
this.$node.hide();
this.on(document, 'dataStatsCounted', this.toggle);
});
}
return defineComponent(mainSelector);
});