[open-ils-commits] r17537 - trunk/Open-ILS/xul/staff_client/server/serial (senator)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Sep 9 09:44:19 EDT 2010


Author: senator
Date: 2010-09-09 09:44:18 -0400 (Thu, 09 Sep 2010)
New Revision: 17537

Modified:
   trunk/Open-ILS/xul/staff_client/server/serial/pattern_wizard.js
Log:
Serials: pattern wizard bugfix

Previously, you couldn't always compile the pattern at the end of the wizard
if you elected not to use certain parts of the wizard, such as enumeration
captions, even though to do so should be perfectly valid.


Modified: trunk/Open-ILS/xul/staff_client/server/serial/pattern_wizard.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/serial/pattern_wizard.js	2010-09-09 13:36:36 UTC (rev 17536)
+++ trunk/Open-ILS/xul/staff_client/server/serial/pattern_wizard.js	2010-09-09 13:44:18 UTC (rev 17537)
@@ -115,7 +115,7 @@
     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 @@
     };
 
     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 @@
     };
 
     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 @@
         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 @@
     };
 
     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);
 



More information about the open-ils-commits mailing list