fix bug in admin
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 16 Nov 2017 19:13:05 +0000 (14:13 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 16 Nov 2017 19:13:05 +0000 (14:13 -0500)
also setting up a lock to make sure your editing adding only one thing
at a time.

js/adminRegApp.js
js/frontRegApp.js
js/views/admin/regRate.js
js/views/front/regRequestRegistrant.js
js/views/front/regTime.js
views/front/registrations/registration.html

index 7d60191..910ea0e 100644 (file)
@@ -378,7 +378,7 @@ app.Views.Admin.RegEvent = Backbone.View.extend({
 
 });
 
-js/views/regRate.js
+//js/views/regRate.js
 
 var calendar = false;
 
index 2c8dce4..664c9f2 100644 (file)
@@ -829,16 +829,23 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
         }
 
         this.$('.reg-edit-form').hide();
+        app.regEventLock = false;
     },
 
     // cancel the edit of model
     cancelEdit: function(){
         this.$('.reg-edit-form').hide();
+        app.regEventLock = false;
     },
 
     // show the edit form
     editRegistrant: function(){
+        if ( app.regEventLock ) {
+            alert('Please finish what your doing first!');
+            return;
+        }
         this.$('.reg-edit-form').show();
+        app.regEventLock = true;
     },
 
     // render the view
@@ -903,6 +910,11 @@ app.Views.Front.RegTime = Backbone.View.extend({
 
     // add new account
     addNewAccount: function(){
+        // check for the lock
+        if ( app.regEventLock ) {
+            alert('Please finish what your doing first!');
+            return;
+        }
         this.$('.glm-add-new-account').hide();
         // Create the new Registrant View
         if ( app.timeSpecific ) {
@@ -912,6 +924,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
         }
         this.newRegAccountView = new app.Views.Front.RegistrantForm({model: this.newRegAccount});
         this.$el.append( this.newRegAccountView.render().el );
+        app.regEventLock = true;
     },
 
     // insert new registrant
@@ -975,7 +988,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
         }
         // this.newRegAccount.destroy();
         this.newRegAccountView.remove();
-        // app.calendar = false;
+        app.regEventLock = false;
     },
 
     // cancel add new registrant
@@ -983,6 +996,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
         this.$('.glm-add-new-account').show();
         // this.newRegAccount.destroy();
         this.newRegAccountView.remove();
+        app.regEventLock = false;
     },
 
     // add a registrant to collection
index 2587b55..92363fd 100644 (file)
@@ -1,4 +1,4 @@
-js/views/regRate.js
+//js/views/regRate.js
 
 var calendar = false;
 
index f1be6a2..15111c8 100644 (file)
@@ -65,16 +65,23 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
         }
 
         this.$('.reg-edit-form').hide();
+        app.regEventLock = false;
     },
 
     // cancel the edit of model
     cancelEdit: function(){
         this.$('.reg-edit-form').hide();
+        app.regEventLock = false;
     },
 
     // show the edit form
     editRegistrant: function(){
+        if ( app.regEventLock ) {
+            alert('Please finish what your doing first!');
+            return;
+        }
         this.$('.reg-edit-form').show();
+        app.regEventLock = true;
     },
 
     // render the view
index b9afd57..2a0cb92 100644 (file)
@@ -38,6 +38,11 @@ app.Views.Front.RegTime = Backbone.View.extend({
 
     // add new account
     addNewAccount: function(){
+        // check for the lock
+        if ( app.regEventLock ) {
+            alert('Please finish what your doing first!');
+            return;
+        }
         this.$('.glm-add-new-account').hide();
         // Create the new Registrant View
         if ( app.timeSpecific ) {
@@ -47,6 +52,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
         }
         this.newRegAccountView = new app.Views.Front.RegistrantForm({model: this.newRegAccount});
         this.$el.append( this.newRegAccountView.render().el );
+        app.regEventLock = true;
     },
 
     // insert new registrant
@@ -110,7 +116,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
         }
         // this.newRegAccount.destroy();
         this.newRegAccountView.remove();
-        // app.calendar = false;
+        app.regEventLock = false;
     },
 
     // cancel add new registrant
@@ -118,6 +124,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
         this.$('.glm-add-new-account').show();
         // this.newRegAccount.destroy();
         this.newRegAccountView.remove();
+        app.regEventLock = false;
     },
 
     // add a registrant to collection
index b0b72eb..077c416 100644 (file)
@@ -245,6 +245,7 @@ var app = {
     {else}
         timeSpecific: false,
     {/if}
+    regEventLock: false,
 };
 var regEvent = '';
 var cart = '';