Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prepend added search result when top form option

  • Loading branch information...
commit 0b36b7b2db5e3cf1da63c400260ef185dffdeb31 1 parent 1e57277
Alex Bredariol Grilo authored
View
2  app/views/questions/show.html.haml
@@ -77,6 +77,8 @@
:answer => @answer })
#search_results
+ - if ab_test(:answer_with_form_position) == :above
+ .new
- @search_results.each do |search_result|
= render(:partial => 'search_results/search_result',
:locals => { :question => @question,
View
6 public/javascripts/modules/show_question.js
@@ -45,7 +45,11 @@ $(document).ready(function() {
success: function(data) {
$('.loader').hide();
var search_result = $(data.html);
- $('#search_results').append(search_result);
+ if($(".new").length > 0){
+ $('.new').prepend(search_result);
+ }else{
+ $('#search_results').append(search_result);
+ }
highlightEffect(search_result);
$('#search_result_url').val('');
},
Please sign in to comment.
Something went wrong with that request. Please try again.