From e4c38033bb3c8e4f44ba93e604652d9eb8e9b0b8 Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Sun, 27 Sep 2015 20:58:05 +0000 Subject: Fix JS switch ... case indentation This is a surprising one. JSHint and JSCS do not seem to mind the previous indentation, but ESLint throws an error when using the Airbnb style guide. The style guide itself doesn't seem to mention anything about this directly. What ever it is, this one pleases all three linters. Fixes ESLint indent warnings using Airbnb ES5 config. --- js/pomf.js | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/js/pomf.js b/js/pomf.js index 2d4ff58..1a11543 100644 --- a/js/pomf.js +++ b/js/pomf.js @@ -142,34 +142,34 @@ $(function() { up.on('load', function(e, response) { switch (e.target.status) { - case 200: - var res = JSON.parse(response); - if (!res.success) { - uploadFiles.addClass('error'); - totalName.text(UPLOAD_ERR_FAILED); - break; - } - - eachRow(res.files, function(row, file, files) { - var link = $(''); - - link.attr('href', file.url) - .attr('target', '_BLANK') - .text(file.url.replace('http://', '').replace('https://', '')); - - $('.file-url', row).append(link); - }); - - uploadFiles.addClass('completed'); - totalName.text('Done!'); - break; - case 413: - uploadFiles.addClass('error completed'); - totalName.html(UPLOAD_ERR_MAX_SIZE); - break; - default: - uploadFiles.addClass('error completed'); + case 200: + var res = JSON.parse(response); + if (!res.success) { + uploadFiles.addClass('error'); totalName.text(UPLOAD_ERR_FAILED); + break; + } + + eachRow(res.files, function(row, file, files) { + var link = $(''); + + link.attr('href', file.url) + .attr('target', '_BLANK') + .text(file.url.replace('http://', '').replace('https://', '')); + + $('.file-url', row).append(link); + }); + + uploadFiles.addClass('completed'); + totalName.text('Done!'); + break; + case 413: + uploadFiles.addClass('error completed'); + totalName.html(UPLOAD_ERR_MAX_SIZE); + break; + default: + uploadFiles.addClass('error completed'); + totalName.text(UPLOAD_ERR_FAILED); } }); -- cgit v1.2.3