From f0e396898910cc17e40734cdda7f3ef51b084d10 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Sun, 21 Sep 2014 15:49:16 -0400 Subject: [PATCH] Linted select2/selection/* --- src/js/select2/selection/multiple.js | 22 +++++++++++----------- src/js/select2/selection/single.js | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/js/select2/selection/multiple.js b/src/js/select2/selection/multiple.js index 7b396f79..f659e05b 100644 --- a/src/js/select2/selection/multiple.js +++ b/src/js/select2/selection/multiple.js @@ -20,34 +20,34 @@ define([ this.$selection = $selection; return $selection; - } + }; MultipleSelection.prototype.bind = function (container, $container) { var self = this; this.$selection.on('click', function (evt) { - self.trigger("toggle", { + self.trigger('toggle', { originalEvent: evt }); }); - container.on("selection:update", function (params) { + container.on('selection:update', function (params) { self.update(params.data); }); - } + }; MultipleSelection.prototype.clear = function () { - this.$selection.find(".rendered-selection").empty(); - } + this.$selection.find('.rendered-selection').empty(); + }; MultipleSelection.prototype.display = function (data) { return data.text; - } + }; MultipleSelection.prototype.update = function (data) { this.clear(); - if (data.length == 0) { + if (data.length === 0) { return; } @@ -61,13 +61,13 @@ define([ var $selection = $(''); $selection.text(formatted); - $selection.data("data", data); + $selection.data('data', data); $selections.push($selection); } - this.$selection.find(".rendered-selection").append($selections); - } + this.$selection.find('.rendered-selection').append($selections); + }; return MultipleSelection; }); diff --git a/src/js/select2/selection/single.js b/src/js/select2/selection/single.js index 7d853763..082dc424 100644 --- a/src/js/select2/selection/single.js +++ b/src/js/select2/selection/single.js @@ -20,7 +20,7 @@ define([ this.$selection = $selection; return $selection; - } + }; SingleSelection.prototype.bind = function (container, $container) { var self = this; @@ -31,26 +31,26 @@ define([ return; } - self.trigger("toggle", { + self.trigger('toggle', { originalEvent: evt }); }); - container.on("selection:update", function (params) { + container.on('selection:update', function (params) { self.update(params.data); - }) - } + }); + }; SingleSelection.prototype.clear = function () { - this.$selection.find(".rendered-selection").empty(); - } + this.$selection.find('.rendered-selection').empty(); + }; SingleSelection.prototype.display = function (data) { return data.text; - } + }; SingleSelection.prototype.update = function (data) { - if (data.length == 0) { + if (data.length === 0) { this.clear(); return; } @@ -59,8 +59,8 @@ define([ var formatted = this.display(selection); - this.$selection.find(".rendered-selection").html(formatted); - } + this.$selection.find('.rendered-selection').html(formatted); + }; return SingleSelection; });