client side cleanup
This commit is contained in:
parent
2825e84c48
commit
2900d797d0
2 changed files with 5 additions and 10 deletions
|
@ -3,18 +3,13 @@ window.$ = require('jquery')
|
|||
|
||||
# on load
|
||||
$ ->
|
||||
# libs requiring full DOM
|
||||
io = require 'socket.io-client'
|
||||
|
||||
# style sheet
|
||||
require './style/custom.scss'
|
||||
|
||||
# # init Socket.IO
|
||||
# socket = io()
|
||||
|
||||
# reset forms
|
||||
$('form').each ->
|
||||
that = @
|
||||
|
||||
@fullReset = ->
|
||||
$('input', that).each ->
|
||||
$(that).removeClass 'is-invalid'
|
||||
|
@ -22,7 +17,7 @@ $ ->
|
|||
that.reset()
|
||||
|
||||
# login form
|
||||
$('form[name="login"]').submit ->
|
||||
$('form[name="login"]').submit (event) ->
|
||||
# inhibit normal form submission
|
||||
event.preventDefault()
|
||||
|
||||
|
@ -40,7 +35,7 @@ $ ->
|
|||
# reset form
|
||||
@fullReset()
|
||||
|
||||
# register form
|
||||
# registration form
|
||||
$('form[name="register"]').submit (event) ->
|
||||
# inhibit normal form submission
|
||||
event.preventDefault()
|
||||
|
|
|
@ -31,7 +31,7 @@ html
|
|||
input.form-control(name="password" type="password" required)
|
||||
|
||||
div.form-group
|
||||
button.btn.btn-primary(type="submit") Login
|
||||
button.btn.btn-primary.w-100.text-center(type="submit") Login
|
||||
|
||||
div.col-md-3
|
||||
h3 Register
|
||||
|
@ -47,4 +47,4 @@ html
|
|||
label(for="confirm") Confirm password:
|
||||
input.form-control(name="confirm" type="password")
|
||||
|
||||
button.btn.btn-primary(type="submit") Register
|
||||
button.btn.btn-primary.w-100.text-center(type="submit") Register
|
||||
|
|
Reference in a new issue