From 408e3cf72b993655ae3b8f8eeb9f8a7b95d21c54 Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Mon, 28 Sep 2015 16:08:36 +0000 Subject: Prefix cheesesteak.js jQuery object variables with a $ This fixes Airbnb ES5 style guide violations. --- js/cabinet.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'js/cabinet.js') diff --git a/js/cabinet.js b/js/cabinet.js index 2f3a3a6..8414df2 100644 --- a/js/cabinet.js +++ b/js/cabinet.js @@ -27,15 +27,15 @@ }; $.fn.cabinet = function(input) { - input = $(input); + var $input = $(input); var _this = this; var passthrough = function(outer, inner, prevent, fn) { _this.on(outer, function(e) { if (inner === 'click') { - input[0].click(); + $input[0].click(); } else { - input.trigger(inner); + $input.trigger(inner); } if (prevent) { @@ -48,9 +48,9 @@ }, false); }; - input[0].filelist = Object.create(FileList); + $input[0].filelist = Object.create(FileList); - input.on('change', function(e) { + $input.on('change', function(e) { this.filelist = e.target.files; _this.change(); }); @@ -60,7 +60,7 @@ passthrough('dragleave', 'dragleave', true); passthrough('click', 'click', false); passthrough('drop', 'dragleave', true, function(e) { - input[0].filelist = e.dataTransfer.files; + $input[0].filelist = e.dataTransfer.files; _this.change(); }); }; -- cgit v1.2.3