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
8f5cf7d9
Commit
8f5cf7d9
authored
Jul 31, 2014
by
Aron Carroll
Committed by
Randall Leeds
Aug 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the status-button to use the compile step
parent
284921ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
status-button.coffee
h/static/scripts/directives/status-button.coffee
+11
-8
No files found.
h/static/scripts/directives/status-button.coffee
View file @
8f5cf7d9
...
...
@@ -23,17 +23,20 @@ statusButton = ->
</span>
'''
compile
:
->
pre
:
(
scope
,
elem
,
attr
)
->
targetForm
=
attr
.
statusButton
compile
:
(
button
,
attr
)
->
targetForm
=
attr
.
statusButton
unless
targetForm
throw
new
Error
(
'status-button attribute should provide a form name'
)
unless
targetForm
throw
new
Error
(
'status-button attribute should provide a form name'
)
wrapper
=
angular
.
element
(
template
)
wrapper
.
insertBefore
(
elem
)
wrapper
.
append
(
elem
)
# Remove the attribute to prevent recusive parsing.
button
.
removeAttr
(
'status-button'
)
wrapper
=
angular
.
element
(
template
)
wrapper
.
insertBefore
(
button
)
wrapper
.
append
(
button
)
post
:
(
scope
,
elem
,
attr
)
->
scope
.
$on
'formState'
,
(
event
,
formName
,
formState
)
->
return
unless
formName
==
targetForm
unless
formState
in
[
STATE_LOADING
,
STATE_SUCCESS
]
...
...
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