DYEBench should use TodoMVC to test FlightJS for consistency
[WebKit-https.git] / PerformanceTests / DoYouEvenBench / resources / todomvc / dependency-examples / flight / app / js / ui / toggle_all.js
1 /*global define */
2 'use strict';
3
4 define([
5     'flight/lib/component'
6 ], function (defineComponent) {
7     function toggleAll() {
8         this.toggleAllComplete = function () {
9             this.trigger('uiToggleAllRequested', {
10                 completed: this.$node.is(':checked')
11             });
12         };
13
14         this.toggleCheckbox = function (e, data) {
15             this.node.checked = !data.remaining;
16         };
17
18         this.after('initialize', function () {
19             this.on('click', this.toggleAllComplete);
20             this.on(document, 'dataStatsCounted', this.toggleCheckbox);
21         });
22     }
23
24     return defineComponent(toggleAll);
25 });