From 401874455490c6300270ef54490fe9452e0ca522 Mon Sep 17 00:00:00 2001 From: Manchere Date: Tue, 16 Feb 2021 11:19:20 -0800 Subject: [PATCH] Fix comment_expand to camelcase (#9206) * Fix comment_expand to camelcase * Fix comment_expand code climate issues (#9206) --- .../javascripts/{comment_expand.js => commentExpand.js} | 4 ++-- app/views/admin/assets.html.erb | 2 +- app/views/questions/show.html.erb | 2 +- config/initializers/assets.rb | 2 +- spec/javascripts/comment_spec.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename app/assets/javascripts/{comment_expand.js => commentExpand.js} (81%) diff --git a/app/assets/javascripts/comment_expand.js b/app/assets/javascripts/commentExpand.js similarity index 81% rename from app/assets/javascripts/comment_expand.js rename to app/assets/javascripts/commentExpand.js index 3af5e965e3..91bee4e7bb 100644 --- a/app/assets/javascripts/comment_expand.js +++ b/app/assets/javascripts/commentExpand.js @@ -1,6 +1,6 @@ function comment_select(question_id){ return $('.answer-' + question_id + '-comments').filter(function(){ - return $(this).css('display') == 'none'; + return $(this).css('display') === 'none'; }) } @@ -8,7 +8,7 @@ function expand_comments(question_id){ if (comment_select(question_id).length > 0){ comment_select(question_id).slice(-3).show(); $('#answer-' + question_id + '-expand').text('View ' + comment_select(question_id).length + ' previous comments'); - if (comment_select(question_id).length == 0){ + if (comment_select(question_id).length === 0){ $('#answer-' + question_id + '-expand').hide(); } } diff --git a/app/views/admin/assets.html.erb b/app/views/admin/assets.html.erb index 7116e7adfe..01ee1f4482 100644 --- a/app/views/admin/assets.html.erb +++ b/app/views/admin/assets.html.erb @@ -4,7 +4,7 @@ <%= javascript_include_tag 'application' %> <%= javascript_include_tag 'advancedSearch' %> -<%= javascript_include_tag 'comment_expand' %> +<%= javascript_include_tag 'commentExpand' %> <%= javascript_include_tag 'dashboard' %> <%= javascript_include_tag 'editorToolbar' %> <%= javascript_include_tag 'locationForm' %> diff --git a/app/views/questions/show.html.erb b/app/views/questions/show.html.erb index 187f2d4a40..f92dbf9390 100644 --- a/app/views/questions/show.html.erb +++ b/app/views/questions/show.html.erb @@ -1,4 +1,4 @@ -<%= javascript_include_tag('comment_expand') %> +<%= javascript_include_tag('commentExpand') %> <%= javascript_include_tag('notes') %> <%= javascript_include_tag('textBoxExpand') %>