diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-09-17 22:15:28 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-09-17 22:15:28 -0400 |
| commit | 7d35fbd21d4f31132ae62a07c1863db5d0325cb2 (patch) | |
| tree | 89e0248375882b0f8845babd0a6ce799821d025e /StoneIsland | |
| parent | 04e0bbd20259cef3b72a0f487b6f2be21e8a4070 (diff) | |
loginview
Diffstat (limited to 'StoneIsland')
| -rw-r--r-- | StoneIsland/www/index.html | 11 | ||||
| -rw-r--r-- | StoneIsland/www/js/lib/nav/LoginView.js | 36 |
2 files changed, 41 insertions, 6 deletions
diff --git a/StoneIsland/www/index.html b/StoneIsland/www/index.html index 25220af4..2cbe762b 100644 --- a/StoneIsland/www/index.html +++ b/StoneIsland/www/index.html @@ -184,14 +184,13 @@ <span class="close"> <div class="login_ask">LOGIN</div> <div class="signup_ask">SIGNUP</div> - <div> - <input type="text" name="username" placeholder="USERNAME / EMAIL"> - <input type="text" name="password" placeholder="PASSWORD"> + <form> + <input type="email" name="email" placeholder="EMAIL" required> + <input type="password" name="password" placeholder="PASSWORD" required> <span class="submit">SIGN IN</span> - </div> + </form> </div> - - + <div id="cart"> <h1>YOUR CART / <span class="itemcount">2 ITEMS</h1> diff --git a/StoneIsland/www/js/lib/nav/LoginView.js b/StoneIsland/www/js/lib/nav/LoginView.js index 0f30db3d..de534e32 100644 --- a/StoneIsland/www/js/lib/nav/LoginView.js +++ b/StoneIsland/www/js/lib/nav/LoginView.js @@ -3,17 +3,53 @@ var LoginView = View.extend({ el: "#login", events: { + "click .close": "hide", + "click .login_ask": "login", + "click .signup_ask": "signup", + "submit form": "submit", }, + mode: null, + initialize: function(){ + this.$form = this.$("form") + this.$email = this.$("[name=email]") + this.$password = this.$("[name=password]") }, show: function(){ + this.$form.hide() + this.$email.val("") + this.$password.val("") document.body.classList.add("login") }, hide: function(){ document.body.classList.remove("login") }, + + login: function(){ + this.mode = "login" + this.$form.show() + }, + + signup: function(){ + this.mode = "signup" + this.$form.show() + }, + + submit: function(e){ + e.preventDefault() + if (this.mode == "login") { + // login api + } + else { + // signup api + } + }, + + success: function(){ + // change login in ui to logout or whatever + }, })
\ No newline at end of file |
