From 744a7f09421e6975b9682bb510fcbd3145bdb873 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 22 Dec 2017 15:03:47 -0500 Subject: [PATCH] WIP for adding attendees try to solve the slowness effecting the adding of attendees. --- js/frontRegApp.js | 9 +++++---- js/views/front/regTime.js | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) 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 -- 2.17.1