UNPKG

todomvc

Version:

> Helping you select an MV\* framework

26 lines (21 loc) 550 B
/*global define */ 'use strict'; define([ 'flight/lib/component' ], function (defineComponent) { function toggleAll() { this.toggleAllComplete = function () { this.trigger('uiToggleAllRequested', { completed: this.$node.is(':checked') }); }; this.toggleCheckbox = function (e, data) { this.node.checked = !data.remaining; }; this.after('initialize', function () { this.on('click', this.toggleAllComplete); this.on(document, 'dataStatsCounted', this.toggleCheckbox); }); } return defineComponent(toggleAll); });