Permalink
Browse files

Prepend added search result when top form option

  • Loading branch information...
1 parent 1e57277 commit 0b36b7b2db5e3cf1da63c400260ef185dffdeb31 Alex Bredariol Grilo committed Nov 10, 2011
Showing with 7 additions and 1 deletion.
  1. +2 −0 app/views/questions/show.html.haml
  2. +5 −1 public/javascripts/modules/show_question.js
@@ -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,
@@ -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('');
},

0 comments on commit 0b36b7b

Please sign in to comment.