Commits

Sean Wilkinson committed 19ed8cd

Disabled "box" inputs until after login

Comments (0)

Files changed (2)

src/browser-client/index.html

           </p>
           <form class="navbar-form">
             <input type="text" id="QM-box-input" class="centered" size="32"
-                pattern="^[\w\-]+" required>
-            <input type="checkbox" id="QM-volunteer-input">
+                pattern="^[\w\-]+" required disabled>
+            <input type="checkbox" id="QM-volunteer-input" disabled>
           </form>
         </div>
       </div>

src/browser-client/main.js

     /*jslint browser: true, indent: 4, maxlen: 80 */
 
     /*properties
-        Q, QM, activeElement, alert, ajax, argv, audience, avar, blur, box,
-        cache, call, clearTimeout, click, client_id, console, dataType,
+        Q, QM, activeElement, alert, ajax, argv, attr, audience, avar, blur,
+        box, cache, call, clearTimeout, click, client_id, console, dataType,
         document, error, exit, focus, getItem, hash, hasOwnProperty, href,
         html, id, is, join, jQuery, key, length, localStorage, location, log,
         on, preventDefault, prototype, push, ready, redirect_uri,
                             }
                             QM.revive();
                             return;
-                        });
+                        }).attr('disabled', false);
                         QM.avar().Q(function (evt) {
                          // This function synchronizes the jQuery object that
                          // represents the input element directly with QM's
                         $('#QM-volunteer-input').click(function volunteer() {
                          // This function runs every time the checkbox is
                          // clicked.
-                            if (!$('#QM-volunteer-input').is(':checked')) {
+                            var that = $('#QM-volunteer-input');
+                            if (that.is(':checked') === false) {
                              // Yes, you're right, it _does_ look inefficient
                              // to ask jQuery to do separate queries, but
                              // because `volunteer` calls itself recursively
                                 return evt.exit();
                             });
                             return;
-                        });
+                        }).attr('disabled', false);
                         return;
                     }
                 });