usability tweak, pull the Create button out of the embedded interfaces and into the...
authorJason Etheridge <jason@esilibrary.com>
Fri, 20 May 2011 07:55:37 +0000 (03:55 -0400)
committerJason Etheridge <jason@esilibrary.com>
Fri, 20 May 2011 14:52:29 +0000 (10:52 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/server/cat/volume_copy_editor.js
Open-ILS/xul/staff_client/server/cat/volume_copy_editor_horiz.xul

index 2938b6a..468f95e 100644 (file)
@@ -30,7 +30,27 @@ function my_init() {
                 'push_xulG' : true,
                 'alt_print' : false,
                 'browser_id' : 'volume_pane',
-                'passthru_content_params' : xulG
+                'passthru_content_params' : xulG,
+                'on_url_load' : function() {
+                    if ($('Create')) { // in horizontal UI variant
+                        // Hide the Create button in the embedded volume creator
+                        var f_content = get_contentWindow( $('volume_pane' ) );
+                        var original_btn = f_content.document.getElementById('Create');
+                        original_btn.hidden = true;
+                        $('Create').setAttribute(
+                            'label',
+                            $('catStrings').getString('staff.cat.volume_copy_creator.create.btn.label')
+                        );
+                        $('Create').setAttribute(
+                            'accesskey',
+                            $('catStrings').getString('staff.cat.volume_copy_creator.create.btn.accesskey')
+                        );
+                        g.stash_and_close = function(p) {
+                            // Wire up the method for the replacement button
+                            f_content.g.stash_and_close(p);
+                        }
+                    }
+                }
             }
         );
 
index fb22e32..99b1276 100644 (file)
@@ -28,6 +28,8 @@
     </script>
     <scripts id="openils_util_scripts"/>
 
+    <messagecatalog id="catStrings" src='/xul/server/locale/<!--#echo var="locale"-->/cat.properties'/>
+
     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
     <script type="text/javascript" src="volume_copy_editor.js"/>
 
             <hbox id="bottom_bar"/>
         </vbox>
     </hbox>
+    <hbox>
+        <spacer flex="1"/>
+        <button id="Create" oncommand="g.stash_and_close('unified_interface');"/>
+    </hbox>
 
 </window>