diff options
| author | Juuso Lapinlampi <wub@partyvan.eu> | 2015-10-04 16:49:47 +0200 |
|---|---|---|
| committer | Juuso Lapinlampi <wub@partyvan.eu> | 2015-10-04 16:49:47 +0200 |
| commit | a2423dc2cb72ffe740599cc038e8c5a74ff2a848 (patch) | |
| tree | 23149840a811ee12f4717f06cf83fb0a13d5bfd3 /js/cabinet.js | |
| parent | 371cba4945b8cf1d5479d3a0a617b7d13420a664 (diff) | |
| parent | 408e3cf72b993655ae3b8f8eeb9f8a7b95d21c54 (diff) | |
Merge branch 'follow-airbnb-jquery' into fix-eslint-warnings-2
Prefix jQuery object variables with a $
Diffstat (limited to 'js/cabinet.js')
| -rw-r--r-- | js/cabinet.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/js/cabinet.js b/js/cabinet.js index 45f1295..2e2408b 100644 --- a/js/cabinet.js +++ b/js/cabinet.js @@ -27,15 +27,15 @@ }; $.fn.cabinet = function(uploadInput) { - var input = $(uploadInput); + var $input = $(uploadInput); 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(); }); }; |
