From a59dda5c9d720fd6ba229d884304642b45a3c762 Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 9 Sep 2010 13:44:54 +0000 Subject: [PATCH] Backport r17537 from trunk: serials pattern wizard bugfix git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@17538 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/serial/pattern_wizard.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/serial/pattern_wizard.js b/Open-ILS/xul/staff_client/server/serial/pattern_wizard.js index 95cbdec117..38a23dde15 100644 --- a/Open-ILS/xul/staff_client/server/serial/pattern_wizard.js +++ b/Open-ILS/xul/staff_client/server/serial/pattern_wizard.js @@ -115,7 +115,7 @@ function CalendarChangeRow() { this.compile = function() { var type = node_by_name("type", this.element).value; - return this["_compile_" + type](); + return type ? this["_compile_" + type]() : []; }; this._init.apply(this, arguments); @@ -169,10 +169,13 @@ function CalendarChangeEditor() { }; this.toggle = function(ev) { - (ev.target.checked ? show : hide)("calendar_change_editor_here"); + this.active = ev.target.checked; + (this.active ? show : hide)("calendar_change_editor_here"); }; this.compile = function() { + if (!this.active) return []; + return [ "x", openils.Util.objectProperties(this.rows).sort(num_sort).map( @@ -286,10 +289,13 @@ function ChronEditor() { }; this.toggle = function(ev) { - (ev.target.checked ? show : hide)("chron_editor_here"); + this.active = ev.target.checked; + (this.active ? show : hide)("chron_editor_here"); }; this.compile = function() { + if (!this.active) return []; + return this.subfields.filter( function(subfield) { return Boolean(self.rows[subfield]); } ).reduce( @@ -457,7 +463,9 @@ function EnumEditor() { var func; var use_calendar_change = dojo.byId("use_calendar_change"); - if (ev.target.checked) { + this.active = ev.target.checked; + + if (this.active) { func = show; use_calendar_change.disabled = false; } else { @@ -471,6 +479,8 @@ function EnumEditor() { }; this.compile = function() { + if (!this.active) return []; + var rows = dojo.mixin({}, this.normal_rows, this.alt_rows); var subfields = [].concat(this.normal_subfields, this.alt_subfields); -- 2.11.0