From 696edb1feb444d21e75f0249ab807aadc5181e0c Mon Sep 17 00:00:00 2001
From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Wed, 4 Aug 2010 19:56:26 +0000
Subject: [PATCH] tweak to item attribute editor to support hiding of fields
 with cat_custom.css

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17078 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/xul/staff_client/server/cat/copy_editor.js  | 11 ++++++-----
 Open-ILS/xul/staff_client/server/cat/copy_editor.xul |  1 +
 Open-ILS/xul/staff_client/server/skin/cat.css        |  3 +++
 Open-ILS/xul/staff_client/server/skin/global.css     |  2 --
 4 files changed, 10 insertions(+), 7 deletions(-)

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 560389f9a2..5a1e780069 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js
+++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js
@@ -1057,8 +1057,8 @@ g.render = function() {
                 }
                 if (typeof g.changed[fn] != 'undefined') groupbox.setAttribute('class','copy_editor_field_changed');
                 caption = document.createElement('caption'); groupbox.appendChild(caption);
-                caption.setAttribute('label',fn); caption.setAttribute('id','caption_'+fn);
-                vbox = document.createElement('vbox'); groupbox.appendChild(vbox);
+                caption.setAttribute('label',fn); 
+                vbox = document.createElement('vbox'); groupbox.appendChild(vbox); // main display widget goes here
                 grid = util.widgets.make_grid( [ { 'flex' : 1 }, {}, {} ] ); vbox.appendChild(grid);
                 grid.setAttribute('flex','1');
                 rows = grid.lastChild;
@@ -1085,10 +1085,11 @@ g.render = function() {
                     }
                     label2.appendChild( document.createTextNode(copy_count) );
                 }
-                var hbox = document.createElement('hbox'); 
-                hbox.setAttribute('id',fn);
+                groupbox.setAttribute('id','groupbox_'+fn); // this id is meant to be referenced by cat_custom.css for hiding fields
+                var hbox = document.createElement('hbox'); // main input controls go here
+                hbox.setAttribute('id',fn); // this id gets used to color areas green, etc.
                 groupbox.appendChild(hbox);
-                var hbox2 = document.createElement('hbox');
+                var hbox2 = document.createElement('hbox'); // cancel/apply buttons go here
                 groupbox.appendChild(hbox2);
 
                 /**************************************************************************************/
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 4117fda296..c58a9ef206 100644
--- a/Open-ILS/xul/staff_client/server/cat/copy_editor.xul
+++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.xul
@@ -6,6 +6,7 @@
 <!-- STYLESHEETS -->
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/cat.css" type="text/css"?>
 
 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
 <!-- LOCALIZATION -->
diff --git a/Open-ILS/xul/staff_client/server/skin/cat.css b/Open-ILS/xul/staff_client/server/skin/cat.css
index ab922f2b5b..13aedb2750 100644
--- a/Open-ILS/xul/staff_client/server/skin/cat.css
+++ b/Open-ILS/xul/staff_client/server/skin/cat.css
@@ -4,3 +4,6 @@
 @namespace html url("http://www.w3.org/TR/REC-html40"); 
 
 .has_copies { color: black; background-color: lightgreen; font-weight: bold; }
+
+.copy_editor_field_changed { background: lightgreen; }
+
diff --git a/Open-ILS/xul/staff_client/server/skin/global.css b/Open-ILS/xul/staff_client/server/skin/global.css
index 519cc60c5a..88361debf7 100644
--- a/Open-ILS/xul/staff_client/server/skin/global.css
+++ b/Open-ILS/xul/staff_client/server/skin/global.css
@@ -111,8 +111,6 @@ iframe { background: #CDCED3 url("chrome://browser/skin/icons/box-background.png
 
 listitem { border-bottom: solid thin black; }
 
-.copy_editor_field_changed { background: lightgreen; }
-
 /*
  * disable Edit Hold Range and Edit Hold Focus by default; should probably be using perms/settings for this
  */
-- 
2.11.0