Commit 308a1c53 authored by Mario Manno's avatar Mario Manno
Browse files

remove event_ratings link_to_function

parent b4d86a8a
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
$(document).ready(function() {
  $("#my_rating").raty({
    path: "",
    starOn: '#{raty_icon_path("on")}',
    starHalf: '#{raty_icon_path("half")}',
    starOff: '#{raty_icon_path("off")}',
    half: true,
    start: $("#event_rating_rating").val(),
    target: "#event_rating_rating",
    targetType: "number",
    targetKeep: true
  });
  $("#total_rating").raty({
    readOnly: true,
    path: "",
    starOn: '#{raty_icon_path("on")}',
    starHalf: '#{raty_icon_path("half")}',
    starOff: '#{raty_icon_path("off")}',
    half: true,
    start: $("#total_rating").data("rating")
  });
  $("td .rating").each(function(index) {
    $(this).raty({
      readOnly: true,
      path: "",
      starOn: '#{raty_icon_path("on")}',
      starHalf: '#{raty_icon_path("half")}',
      starOff: '#{raty_icon_path("off")}',
      half: true,
      start: $(this).data('rating')
    });
  });

  $('[data-function="toggle-description"]').click(function() {
    $('#full_description').toggle();
    return false
  });

});
+0 −2
Original line number Diff line number Diff line
class RatingInput < FormtasticBootstrap::Inputs::HiddenInput
  def to_html
    generic_input_wrapping do
    builder.hidden_field(method, input_html_options) + "<div id=\"my_rating\"></div>".html_safe
  end
end
end
+2 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
    %li= link_to "Feedback", event_event_feedbacks_path(@event)
  .row
    .span16
      %small= link_to_function "Toggle Description >>", "$('#full_description').toggle();"
      %small= link_to "Toggle Description >>", "#", data: { function: 'notification-defaults' }
  #full_description{:style => "display:none;"}
    .row
      .span16
@@ -146,3 +146,4 @@
      });
    });
  });