From 8963026d176bb4f3fef5caedc74bcfce006764d2 Mon Sep 17 00:00:00 2001 From: jambun Date: Tue, 26 May 2015 10:02:33 -0400 Subject: [PATCH] when hiding, also hide the sidebar entry --- frontend/assets/user_defined_in_basic.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/assets/user_defined_in_basic.js b/frontend/assets/user_defined_in_basic.js index 8d593c6..7157013 100644 --- a/frontend/assets/user_defined_in_basic.js +++ b/frontend/assets/user_defined_in_basic.js @@ -20,13 +20,11 @@ UserDefinedInBasic.prototype.init = function(fields, read_only_view, hide_user_d // hide the remains of the user defined section if configured thus if (hide_user_defined_section) { - if (read_only_view) { - $('section[id$=_user_defined_]').hide(); - } else { - user_defined_section.hide(); - } + $('section[id$=_user_defined_]').hide(); + $('li[class^=sidebar-entry][class$=user_defined_]').hide(); } else { if (!read_only_view) { + // if we're not hiding then disable the remove button user_defined_section.find('.subrecord-form-remove').attr('disabled', 'disabled'); } }