diff options
| author | Juuso Lapinlampi <wub@partyvan.eu> | 2015-11-18 13:24:32 +0100 |
|---|---|---|
| committer | Juuso Lapinlampi <wub@partyvan.eu> | 2015-11-18 13:24:32 +0100 |
| commit | d527b2d6769bdc0d2cd6744f1bda9d8da74ef6a6 (patch) | |
| tree | 4c16b575c5497d0f87b9c0a80f9a20cb12120e01 /js | |
| parent | f413dc9a1b944fd653c3bc089516c3363fb57857 (diff) | |
Rename local variables to unique private names
When a local variable shares the same name with a variable in its scope,
it can cause confusion to the reader and make it impossible to access
the global variable.
Disallow shadowing. Fixes ESLint no-shadow errors using airbnb/legacy
config.
Suggested-by: marc <mharnos@gmail.com>
Diffstat (limited to 'js')
| -rw-r--r-- | js/pomf.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -100,13 +100,13 @@ $(function() { var UPLOAD_ERR_FAILED = 'Something went wrong; try again later.'; var up = files.upload('upload.php'); - var eachRow = function(files, fn) { + var eachRow = function(_files, fn) { var hits = {}; - files.forEach(function(file) { + _files.forEach(function(file) { var row = $($('li[data-filename="' + escape(file.name) + '"]')[hits[file.name] || 0]); ++hits[file.name]; - fn.call(row, row, file, files); + fn.call(row, row, file, _files); }); }; @@ -124,12 +124,12 @@ $(function() { return; } - up.on('uploadprogress', function(evt, files) { - eachRow(files, function(row, file) { + up.on('uploadprogress', function(evt, _files) { + eachRow(_files, function(row, file) { $('.progress-inner', row).width((file.percentUploaded * 100) + '%'); }); - $('.progress-inner', totalRow).width((files.percentUploaded * 100) + '%'); + $('.progress-inner', totalRow).width((_files.percentUploaded * 100) + '%'); }); up.on('uploadcomplete', function() { |
