From 0891a8e8c2152e3c459d2686b2228453af4ec894 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 11 Jan 2012 13:57:43 -0500 Subject: [PATCH] LP914821 template selection should be sticky in Unified Volume/Copy Editor. Signed-off-by: Jason Etheridge Signed-off-by: Jason Stephenson Signed-off-by: Mike Rylander --- Open-ILS/xul/staff_client/server/cat/copy_editor.js | 10 +++++++++- Open-ILS/xul/staff_client/server/cat/volume_copy_editor.js | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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 cf541ff12c..800c727e45 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -272,6 +272,7 @@ g.retrieve_templates = function() { xulG.update_unified_template_list(list); // functions the unified wrapper should use to let the item attribute editor do the heavy lifting for templates xulG.update_item_editor_template_selection = function(new_value) { + g.template_menu.setAttribute('value', new_value); g.template_menu.value = new_value; g.copy_editor_prefs[ 'template_menu' ] = { 'value' : g.template_menu.value }; g.save_attributes(); @@ -1278,7 +1279,14 @@ g.render = function() { } catch(E) { alert(E); } } } - if (g.template_menu) g.template_menu.value = g.template_menu.getAttribute('value'); + if (g.template_menu) { + g.template_menu.value = g.template_menu.getAttribute('value'); + if (xulG.unified_interface) { + if (typeof xulG.update_unified_template_selection == 'function') { + xulG.update_unified_template_selection(g.template_menu.value); + } + } + } } diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_editor.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_editor.js index 28f3c78c24..a0dc8c1ba9 100644 --- a/Open-ILS/xul/staff_client/server/cat/volume_copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_editor.js @@ -110,6 +110,12 @@ function setup_templates() { } }; + // used for loading default template selection + xulG.update_unified_template_selection = function(value) { + g.template_menu.setAttribute('value', value); + g.template_menu.value = value; + }; + } catch(E) { alert('Error in volume_copy_editor.js, setup_templates(): ' + E); } -- 2.11.0