1(function ($, APP) { 2 'use strict'; 3 4 APP.Controls.Partial.HistoryPollingWinners = can.Control.extend( 5 { 6 defaults: { 7 year: '.js-year', 8 winner: '.js-year-winner', 9 } 10 }, 11 { 12 init: function () { 13 this.$year = this.element.find(this.options.year); 14 this.$winner = this.element.find(this.options.winner); 15 this.check(); 16 }, 17 18 '{year} click': function($el) { 19 20 if ($el.hasClass("active")) { 21 return; 22 } 23 24 this.$year.removeClass("active"); 25 $el.addClass("active"); 26 this.check(); 27 }, 28 29 check: function ( ) { 30 var $active = this.$year.filter(".active"); 31 var year = $active.data("year"); 32 33 this.$winner.each(function (i, item) { 34 var $item = $(item); 35 36 if ($item.data('year') == year) { 37 $item.addClass("active"); 38 } else { 39 $item.removeClass("active"); 40 } 41 }); 42 } 43 } 44 ); 45 46})(jQuery, APP);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.