From 9082d6c16a222374caa57f987e0af3faab52d26d Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 15 Apr 2015 12:33:16 -0300 Subject: [PATCH] manage_field: fix Javascript --- app/views/features/manage_fields.html.erb | 4 ++-- public/javascripts/manage-fields.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/features/manage_fields.html.erb b/app/views/features/manage_fields.html.erb index f57e9ad..8ca86db 100644 --- a/app/views/features/manage_fields.html.erb +++ b/app/views/features/manage_fields.html.erb @@ -1,5 +1,7 @@

<%= _('Manage fields displayed for profiles') %>

+<%= javascript_include_tag "manage-fields.js" %> + <% tabs = [] %> <% tabs << {:title => _("Person's fields"), :id => 'person-fields', :content => (render :partial => 'manage_person_fields')} %> @@ -11,5 +13,3 @@ <% end %> <%= render_tabs(tabs) %> - -<%= javascript_include_tag "manage-fields.js" %> diff --git a/public/javascripts/manage-fields.js b/public/javascripts/manage-fields.js index 95e254b..9c0b678 100644 --- a/public/javascripts/manage-fields.js +++ b/public/javascripts/manage-fields.js @@ -57,7 +57,7 @@ jQuery(document).ready(function(){ } var checkbox = jQuery(checkboxes[i+3]).attr("id").split("_") - jQuery("#" + checkbox.first() + "_" + checkbox.last()).attr("checked", allchecked) + jQuery("#" + checkbox[0] + "_" + checkbox[checkbox.length-1]).attr("checked", allchecked) } } @@ -74,10 +74,10 @@ jQuery(document).ready(function(){ jQuery("input[type='checkbox']").click(function (){ var checkbox = jQuery(this).attr("id").split("_") - verify_checked(checkbox.first()) + verify_checked(checkbox[0]) if(this.checked == false) { - jQuery("#" + checkbox.first() + "_" + checkbox.last()).attr("checked", false) + jQuery("#" + checkbox[0] + "_" + checkbox[checkbox.length-1]).attr("checked", false) } }) }) -- libgit2 0.21.2