Update for saving custom fields when updating attendees.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 20 Dec 2017 16:40:18 +0000 (11:40 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 20 Dec 2017 16:41:01 +0000 (11:41 -0500)
Adding , {wait: true} to the model.save call for the saving of the
registrant data. This makes backbone wait until the server responds to
render the view again.
Updating style for cancel to be buttons with spacing.

css/front.css
js/frontRegApp.js
js/views/front/regRequestRegistrant.js
views/front/registrations/registration.html

index 87bc0dd..3a60d05 100644 (file)
 }
 .glm-reg-event-profile-details-container{
     padding: 0 0 0 50px;
-    
+
 }
 .glm-reg-class-container{
-    
+
 }
 .glm-reg-row {
     clear: both;
     height: auto;
     float: left;
 }
-.glm-reg-header-row.glm-cart-summary-event-name-row a { 
+.glm-reg-header-row.glm-cart-summary-event-name-row a {
     color: white;
 }
 .glm-reg-header-row .glm-cart-summary-event-name {
@@ -386,7 +386,7 @@ body .glm-reg-proceed-to-checkout{
     font-size: 16px !important;
 }
 .reg-class-detail {
-    display: none; 
+    display: none;
     padding: 5px 10px;
 }
 .toggle-class-open {
@@ -410,7 +410,7 @@ body .glm-reg-proceed-to-checkout{
 /*    -moz-column-count: 2;
     column-count: 2;
     -webkit-column-count: 2;*/
-    
+
 }
 /*}}} End Event Registration Page */
 
@@ -584,7 +584,7 @@ span.glm-error {
 
 /* Reg detail styles */
 #regApp {
-    
+
 }
 #regApp .reg-edit-form {
     float: left;
@@ -617,9 +617,10 @@ span.glm-error {
     float: left;
     margin-bottom: 0;
 }
-#regApp .reg-edit-form .update-registrant-button-container .update-registrant.cancel {
+#regApp .reg-edit-form .update-registrant-button-container .update-registrant-cancel {
     float: right;
     padding: 10px;
+    margin-left: 10px;
 }
 #accountHeader .glm-reg-header-btn{
     font-size: 16px;
@@ -806,7 +807,7 @@ span.glm-error {
     .glm-reg-image-container {
         text-align: left;
     }
-    
+
     #accountHeader #glm-header-reg-widget {
         width: 100%;
     }
@@ -823,7 +824,7 @@ span.glm-error {
     .glm-reg-classes {
 /*        padding: 0;*/
     }
-    
+
     #glm-reg-event-name {
         padding: 0;
         line-height: 1.2;
@@ -843,23 +844,23 @@ span.glm-error {
         float: left;
         width: 450px;
     }
-    
+
     .reg-class-time {
         padding: 5px 5px 15px;
         width: 100%;
         float: left;
-        
+
     /*    -moz-column-count: 2;
         column-count: 2;
         -webkit-column-count: 2;*/
-    
+
     }
-    
+
 }
 /* PROGRESS BAR */
 .progress-container {
 /*      width: 600px;*/
-      margin: 35px auto; 
+      margin: 35px auto;
   }
   .progressbar {
       counter-reset: step;
@@ -914,7 +915,7 @@ span.glm-error {
 
 /* Cart Styles */
 #glm-cart-checkout-button {
-    
+
 }
 .button.glm-reg-button {
     font-size: 16px;
@@ -956,7 +957,7 @@ span.glm-error {
     background-color: white;
     height: 30px;
     overflow: hidden;
-    
+
 }
 .glm-reg-progress-bar-section {
     height: 30px;
index 1fcfd05..2eea7df 100644 (file)
@@ -801,7 +801,7 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
         // Validate the model
         // Have to require reg_time if app.timeSpecific is true
         // Get the form values and update the model.
-        this.model.set({
+        this.model.save({
             option: 'update',
             id: this.model.get('id'),
             reg_request: this.model.get('reg_request'),
@@ -817,8 +817,8 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
             country: country,
             reg_time: this.model.get('reg_time'),
             customFields: customFieldData,
-        });
-        this.model.save();
+        }, {wait: true});
+        // this.model.save();
         if ( this.model.validationError ) {
             // console.log( this.model.validationError );
         }
index 96d0399..3a4f1e6 100644 (file)
@@ -55,7 +55,7 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
         // Validate the model
         // Have to require reg_time if app.timeSpecific is true
         // Get the form values and update the model.
-        this.model.set({
+        this.model.save({
             option: 'update',
             id: this.model.get('id'),
             reg_request: this.model.get('reg_request'),
@@ -71,8 +71,8 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
             country: country,
             reg_time: this.model.get('reg_time'),
             customFields: customFieldData,
-        });
-        this.model.save();
+        }, {wait: true});
+        // this.model.save();
         if ( this.model.validationError ) {
             // console.log( this.model.validationError );
         }
index 16ae872..f939813 100644 (file)
         </div>
     <div>
         <input class="add-new-registrant button tiny" value="Save {/literal}{$terms.reg_term_attendee_cap}{literal}" type="submit">
-        <a class="add-new-registrant-cancel">Cancel</a>
+        <a class="add-new-registrant-cancel button tiny">Cancel</a>
     </div>
 </script>
 {/literal}
             {/if}{literal}
             <div class="update-registrant-button-container">
                 <input class="update-registrant button tiny" value="Update {/literal}{$terms.reg_term_attendee_cap}{literal}" type="submit">
-                <a class="update-registrant-cancel">Cancel</a>
+                <a class="update-registrant-cancel button tiny">Cancel</a>
             </div>
         </div>
     <% } %>