From 567f4aabe10e6ad1dd832c17fb584de1f5b3fc14 Mon Sep 17 00:00:00 2001 From: Fabio Teixeira Date: Tue, 14 Jul 2015 13:51:11 -0300 Subject: [PATCH] Add tooltop span and fix javascript show/hide method --- public/style.css | 2 +- public/views/comments-software-extra-fields.js | 12 ++++++------ views/comments_extra_fields.html.erb | 15 +++++++++++---- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/public/style.css b/public/style.css index daea888..d6e3fe2 100644 --- a/public/style.css +++ b/public/style.css @@ -164,7 +164,7 @@ } /*===== Communities rate hotspot extra fields =====*/ -.comments-software-extra-fields span { +#comments-additional-information { cursor: pointer; } diff --git a/public/views/comments-software-extra-fields.js b/public/views/comments-software-extra-fields.js index 93967df..e49a2fe 100644 --- a/public/views/comments-software-extra-fields.js +++ b/public/views/comments-software-extra-fields.js @@ -5,26 +5,26 @@ modulejs.define('CommentsSoftwareExtraFields', ['jquery'], function($) { information_display_state: "hidden" } - function set_show_aditional_information() { - $(".comments-software-extra-fields span").on("click", function() { + function set_show_additional_information() { + $("#comments-additional-information").on("click", function() { if (DATA.information_display_state === "hidden") { DATA.information_display_state = "show"; - $(this).parent().children("div").show(); + $(".comments-software-extra-fields div").show(); } else { DATA.information_display_state = "hidden"; - $(this).parent().children("div").hide(); + $(".comments-software-extra-fields div").hide(); } }); } return { isCurrentPage: function() { - return $(".comments-software-extra-fields span").length === 1; + return $(".star-rate-form").length === 1; }, init: function() { - set_show_aditional_information(); + set_show_additional_information(); } } }); diff --git a/views/comments_extra_fields.html.erb b/views/comments_extra_fields.html.erb index f0fdf7f..3bf677d 100644 --- a/views/comments_extra_fields.html.erb +++ b/views/comments_extra_fields.html.erb @@ -1,14 +1,21 @@ -
- - <%= _("Aditional informations") %> +
+ + <%= _("Additional informations") %> + +
+ +
<%= label_tag "comments_people_benefited", _("Number of Beneficiaries")%> + <%= text_field_tag "comments[people_benefited]", "" %>
+
<%= label_tag "comments_saved_value", _("Saved resources")%> - <%= text_field_tag "comments[saved_value]", ""%> + + <%= text_field_tag "comments[saved_value]", "", :placeholder=>"R$"%>
-- libgit2 0.21.2