since the shrink bindings is chrome, this is what I had to do get the shrinkable...
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Aug 2006 18:22:02 +0000 (18:22 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Aug 2006 18:22:02 +0000 (18:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5782 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/summary.js
Open-ILS/xul/staff_client/server/patron/summary_overlay.xul

index 19f0404..e532cd8 100644 (file)
@@ -486,6 +486,40 @@ patron.summary.prototype = {
 
                obj.retrieve();
 
+               try {
+                       var caption = document.getElementById("PatronSummaryContact_caption");
+                       var arrow = document.getAnonymousNodes(caption)[0];
+                       var gb_content = document.getAnonymousNodes(caption.parentNode)[1];
+                       arrow.addEventListener(
+                               'click',
+                               function() {
+                                       setTimeout(
+                                               function() {
+                                                       //alert('setting shrink_state to ' + gb_content.hidden);
+                                                       //caption.setAttribute('shrink_state',gb_content.hidden);
+                                                       netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+                                                       JSAN.use('util.file'); var file = new util.file('patron_id_shrink');
+                                                       file.set_object(String(gb_content.hidden)); file.close();
+                                               }, 0
+                                       );
+                               }, false
+                       );
+                       //var shrink_state = caption.getAttribute('shrink_state');
+                       var shrink_state = false;
+                       netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+                       JSAN.use('util.file'); var file = new util.file('patron_id_shrink');
+                       if (file._file.exists()) {
+                               shrink_state = file.get_object(); file.close();
+                       }
+                       //alert('shrink_state retrieved as ' + shrink_state);
+                       if (shrink_state != 'false' && shrink_state) {
+                               JSAN.use('util.widgets');
+                               //alert('clicking the widget');
+                               util.widgets.click( arrow );
+                       }
+               } catch(E) {
+                       obj.error.sdump('D_ERROR','with shrink_state in summary.js: ' + E);
+               }
        },
 
        'retrieve' : function() {
index 771d144..e1a1494 100644 (file)
@@ -34,7 +34,7 @@
 </vbox>
 
 <groupbox id="PatronSummaryStatus_groupbox" orient="vertical">
-       <caption label="&staff.patron_display.status.caption;" class="shrinkable_groupbox"/>
+       <caption label="&staff.patron_display.status.caption;" class="shrinkable_groupbox" />
        <grid style="border: solid thin"><columns><column/></columns><rows>
                <row hidden="true">
                        <label id="patron_standing" />
        <!--
        <caption label="&staff.patron_display.contact.caption;"/>
        -->
-       <caption label="ID/Contact Info" class="shrinkable_groupbox"/>
+       <caption id="PatronSummaryContact_caption" label="ID/Contact Info" class="shrinkable_groupbox" />
        <hbox id="pdcgbhb1">
                <grid id="PatronSummaryContact_grid" />
                <spacer id="pdcgbhbs1" flex="1"/>