Skip to content

Commit

Permalink
Fix comment_expand to camelcase (#9206)
Browse files Browse the repository at this point in the history
* Fix comment_expand to camelcase

* Fix comment_expand code climate issues (#9206)
  • Loading branch information
manchere authored Feb 16, 2021
1 parent 08bc520 commit 4018744
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
function comment_select(question_id){
return $('.answer-' + question_id + '-comments').filter(function(){
return $(this).css('display') == 'none';
return $(this).css('display') === 'none';
})
}

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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/assets.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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' %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/questions/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= javascript_include_tag('comment_expand') %>
<%= javascript_include_tag('commentExpand') %>
<%= javascript_include_tag('notes') %>
<%= javascript_include_tag('textBoxExpand') %>
<script>
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

'advancedSearch.js',
'application.js',
'comment_expand.js',
'commentExpand.js',
'comment.js',
'dashboard.js',
'editorToolbar.js',
Expand Down
2 changes: 1 addition & 1 deletion spec/javascripts/comment_spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-empty-label */
/* eslint-disable no-unused-expressions */
//= require comment_expand
//= require commentExpand

describe("Comments", function() {

Expand Down

0 comments on commit 4018744

Please sign in to comment.