From 681a966c45610f34971e9f8dcc7b4a730695c873 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 15 Mar 2012 13:52:20 -0400 Subject: [PATCH] wire up util.hide in the item attribute editor Currently, hidden elements may still be affected through templates. Thanks goes to MassLNC for this one. Based on SC-D3 at http://www.esilibrary.com/esi/docs/?p=841, with some implementation simplifications. Signed-off-by: Jason Etheridge Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ Open-ILS/xul/staff_client/server/cat/copy_editor.js | 5 +++++ Open-ILS/xul/staff_client/server/cat/copy_editor.xul | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 7acd10d83e..29e809c157 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -2768,6 +2768,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index 800c727e45..2d1579cf62 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -224,6 +224,9 @@ function my_init() { g.hide_copy_notes_button(); } + JSAN.use('util.hide'); + util.hide.generate_css('ui.hide_copy_editor_fields'); + } catch(E) { var err_msg = $("commonStrings").getFormattedString('common.exception', ['cat/copy_editor.js', E]); try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); dump(js2JSON(E)); } @@ -1209,6 +1212,7 @@ g.render = function() { try { var f = g.panes_and_field_names[h][i]; var fn = f[0]; var attr = f[1].attr; groupbox = document.createElement('groupbox'); document.getElementById(h).appendChild(groupbox); + groupbox.setAttribute('hideable',fn); if (attr) { for (var a in attr) { groupbox.setAttribute(a,attr[a]); @@ -1217,6 +1221,7 @@ g.render = function() { caption = document.createElement('caption'); groupbox.appendChild(caption); caption.setAttribute('label',fn); caption.setAttribute('id','caption_'+fn); // used for focus/keyboard navigation + caption.setAttribute('hideable',fn); vbox = document.createElement('vbox'); groupbox.appendChild(vbox); // main display widget goes here if (typeof g.changed[fn] != 'undefined') { addCSSClass(vbox,'copy_editor_field_changed'); } if (typeof g.required[fn] != 'undefined') { addCSSClass(vbox,'copy_editor_field_required'); } diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.xul b/Open-ILS/xul/staff_client/server/cat/copy_editor.xul index 5105ec13e5..b72d537b0c 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.xul +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.xul @@ -85,6 +85,11 @@ +