Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
5e48d324
Commit
5e48d324
authored
Sep 27, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show spinner on account and auth form submits
Close #1213
parent
7f693bfa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
auth.coffee
h/static/scripts/auth/auth.coffee
+5
-0
account-management.coffee
h/static/scripts/controllers/account-management.coffee
+4
-1
status-button.coffee
h/static/scripts/directives/status-button.coffee
+1
-1
No files found.
h/static/scripts/auth/auth.coffee
View file @
5e48d324
...
@@ -31,6 +31,11 @@ class AuthController
...
@@ -31,6 +31,11 @@ class AuthController
angular
.
bind
(
this
,
failure
,
form
)
angular
.
bind
(
this
,
failure
,
form
)
session
.
$resolved
=
false
session
.
$resolved
=
false
# Update status btn
$scope
.
$broadcast
'formState'
,
form
.
$name
,
'loading'
session
.
$promise
.
finally
->
$scope
.
$broadcast
'formState'
,
form
.
$name
,
''
$scope
.
$on
'$destroy'
,
->
$scope
.
$on
'$destroy'
,
->
if
timeout
if
timeout
$timeout
.
cancel
timeout
$timeout
.
cancel
timeout
...
...
h/static/scripts/controllers/account-management.coffee
View file @
5e48d324
...
@@ -14,7 +14,7 @@ class AccountManagement
...
@@ -14,7 +14,7 @@ class AccountManagement
form
.
$setPristine
()
form
.
$setPristine
()
formModel
=
form
.
$name
.
slice
(
0
,
-
4
)
formModel
=
form
.
$name
.
slice
(
0
,
-
4
)
$scope
[
formModel
]
=
{}
# Reset form fields.
$scope
[
formModel
]
=
{}
# Reset form fields.
$scope
.
$broadcast
'formState'
,
form
.
$name
,
'success'
# Update status btn
onDelete
=
(
form
,
response
)
->
onDelete
=
(
form
,
response
)
->
identity
.
logout
()
identity
.
logout
()
...
@@ -29,6 +29,8 @@ class AccountManagement
...
@@ -29,6 +29,8 @@ class AccountManagement
else
else
flash
(
'error'
,
'Sorry, we were unable to perform your request'
)
flash
(
'error'
,
'Sorry, we were unable to perform your request'
)
$scope
.
$broadcast
'formState'
,
form
.
$name
,
''
# Update status btn
# Data for each of the forms
# Data for each of the forms
$scope
.
editProfile
=
{}
$scope
.
editProfile
=
{}
$scope
.
changePassword
=
{}
$scope
.
changePassword
=
{}
...
@@ -67,6 +69,7 @@ class AccountManagement
...
@@ -67,6 +69,7 @@ class AccountManagement
successHandler
=
angular
.
bind
(
null
,
onSuccess
,
form
)
successHandler
=
angular
.
bind
(
null
,
onSuccess
,
form
)
errorHandler
=
angular
.
bind
(
null
,
onError
,
form
)
errorHandler
=
angular
.
bind
(
null
,
onError
,
form
)
$scope
.
$broadcast
'formState'
,
form
.
$name
,
'loading'
# Update status btn
promise
=
profile
.
edit_profile
(
packet
)
promise
=
profile
.
edit_profile
(
packet
)
promise
.
$promise
.
then
(
successHandler
,
errorHandler
)
promise
.
$promise
.
then
(
successHandler
,
errorHandler
)
...
...
h/static/scripts/directives/status-button.coffee
View file @
5e48d324
...
@@ -29,7 +29,7 @@ statusButton = ->
...
@@ -29,7 +29,7 @@ statusButton = ->
unless
targetForm
unless
targetForm
throw
new
Error
(
'status-button attribute should provide a form name'
)
throw
new
Error
(
'status-button attribute should provide a form name'
)
elem
=
angular
.
element
(
template
)
elem
=
angular
.
element
(
template
)
.
attr
(
STATE_ATTRIBUTE
,
''
)
placeholder
.
after
(
elem
)
placeholder
.
after
(
elem
)
transclude
(
scope
,
(
clone
)
->
elem
.
append
(
clone
))
transclude
(
scope
,
(
clone
)
->
elem
.
append
(
clone
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment