From: Steve Sutton Date: Fri, 22 Dec 2017 20:03:47 +0000 (-0500) Subject: WIP for adding attendees X-Git-Tag: v1.0.0^2~139 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=744a7f09421e6975b9682bb510fcbd3145bdb873;p=WP-Plugins%2Fglm-member-db-registrations.git WIP for adding attendees try to solve the slowness effecting the adding of attendees. --- diff --git a/js/frontRegApp.js b/js/frontRegApp.js index 2eea7df..5767f52 100644 --- a/js/frontRegApp.js +++ b/js/frontRegApp.js @@ -905,8 +905,8 @@ app.Views.Front.RegTime = Backbone.View.extend({ this.listenTo( this.model.registrants, 'add', this.addOne ); // this.listenTo( this.model.registrants, 'create', this.render ); this.listenTo( this.model.registrants, 'remove', this.deleteOne ); - this.listenTo( this.model, 'change', this.render ); - this.listenTo( this.model.registrants, 'change', this.render ); + // this.listenTo( this.model, 'change', this.render ); + // this.listenTo( this.model.registrants, 'change', this.render ); return this; }, @@ -929,6 +929,7 @@ app.Views.Front.RegTime = Backbone.View.extend({ }); var accountContainer = this.$('.reg-class-accounts'); accountContainer.append(view); + app.regEventLock = false; return this; }, @@ -1017,7 +1018,7 @@ app.Views.Front.RegTime = Backbone.View.extend({ zip: zip, country: country, customFields: customFieldData, - }); + },{wait: true}); this.$('.glm-add-new-account').show(); this.newRegAccount.destroy(); @@ -1038,7 +1039,7 @@ app.Views.Front.RegTime = Backbone.View.extend({ console.log( 'regTime: addOne called' ); // console.log( item.get('id') ); this.model.set({selectedTime: item.get('reg_time') }) - // this.render(); + this.render(); }, // delete a registrant in collection diff --git a/js/views/front/regTime.js b/js/views/front/regTime.js index 150921a..1aa3fef 100644 --- a/js/views/front/regTime.js +++ b/js/views/front/regTime.js @@ -12,8 +12,8 @@ app.Views.Front.RegTime = Backbone.View.extend({ this.listenTo( this.model.registrants, 'add', this.addOne ); // this.listenTo( this.model.registrants, 'create', this.render ); this.listenTo( this.model.registrants, 'remove', this.deleteOne ); - this.listenTo( this.model, 'change', this.render ); - this.listenTo( this.model.registrants, 'change', this.render ); + // this.listenTo( this.model, 'change', this.render ); + // this.listenTo( this.model.registrants, 'change', this.render ); return this; }, @@ -36,6 +36,7 @@ app.Views.Front.RegTime = Backbone.View.extend({ }); var accountContainer = this.$('.reg-class-accounts'); accountContainer.append(view); + app.regEventLock = false; return this; }, @@ -124,7 +125,7 @@ app.Views.Front.RegTime = Backbone.View.extend({ zip: zip, country: country, customFields: customFieldData, - }); + },{wait: true}); this.$('.glm-add-new-account').show(); this.newRegAccount.destroy(); @@ -145,7 +146,7 @@ app.Views.Front.RegTime = Backbone.View.extend({ console.log( 'regTime: addOne called' ); // console.log( item.get('id') ); this.model.set({selectedTime: item.get('reg_time') }) - // this.render(); + this.render(); }, // delete a registrant in collection