Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
f8a8999a
Commit
f8a8999a
authored
Jun 07, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cached jQuery selectors
parent
04c199a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
app/assets/javascripts/right_sidebar.js.coffee
app/assets/javascripts/right_sidebar.js.coffee
+15
-14
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+4
-5
No files found.
app/assets/javascripts/right_sidebar.js.coffee
View file @
f8a8999a
...
@@ -47,40 +47,41 @@ class @Sidebar
...
@@ -47,40 +47,41 @@ class @Sidebar
.
off
'click'
,
'.js-issuable-todo'
.
off
'click'
,
'.js-issuable-todo'
.
on
'click'
,
'.js-issuable-todo'
,
@
toggleTodo
.
on
'click'
,
'.js-issuable-todo'
,
@
toggleTodo
toggleTodo
:
(
e
)
->
toggleTodo
:
->
$this
=
$
(
@
)
$this
=
$
(
@
)
$btnText
=
$this
.
find
(
'span'
)
$todoLoading
=
$
(
'.js-issuable-todo-loading'
)
data
=
{
$btnText
=
$
(
'.js-issuable-todo-text'
,
$this
)
todo_id
:
$this
.
attr
(
'data-id'
)
}
$
.
ajax
(
$
.
ajax
(
url
:
$this
.
data
(
'url'
)
url
:
$this
.
data
(
'url'
)
type
:
'POST'
type
:
'POST'
dataType
:
'json'
dataType
:
'json'
data
:
data
data
:
todo_id
:
$this
.
attr
(
'data-id'
)
beforeSend
:
->
beforeSend
:
->
$this
.
disable
()
$this
.
disable
()
$
(
'.js-issuable-todo-loading'
)
.
removeClass
'hidden'
$
todoLoading
.
removeClass
'hidden'
).
done
(
data
)
->
).
done
(
data
)
->
$todoPendingCount
=
$
(
'.todos-pending-count'
)
$todoPendingCount
=
$
(
'.todos-pending-count'
)
$todoPendingCount
.
text
data
.
count
$todoPendingCount
.
text
data
.
count
$this
.
enable
()
$this
.
enable
()
$
(
'.js-issuable-todo-loading'
)
.
addClass
'hidden'
$
todoLoading
.
addClass
'hidden'
if
data
.
count
is
0
if
data
.
count
is
0
$todoPendingCount
$todoPendingCount
.
addClass
'hidden'
.
addClass
'hidden'
else
else
$todoPendingCount
$todoPendingCount
.
removeClass
'hidden'
.
removeClass
'hidden'
if
data
.
todo
?
if
data
.
todo
?
$this
.
attr
'aria-label'
,
$this
.
data
(
'mark-text'
)
.
attr
'data-id'
,
data
.
todo
.
id
$btnText
.
text
$this
.
data
(
'mark-text'
)
$btnText
.
text
$this
.
data
(
'mark-text'
)
$this
.
attr
'data-id'
,
data
.
todo
.
id
else
else
$this
.
removeAttr
'data-id'
$this
.
attr
'aria-label'
,
$this
.
data
(
'todo-text'
)
.
removeAttr
'data-id'
$btnText
.
text
$this
.
data
(
'todo-text'
)
$btnText
.
text
$this
.
data
(
'todo-text'
)
sidebarDropdownLoading
:
(
e
)
->
sidebarDropdownLoading
:
(
e
)
->
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
f8a8999a
...
@@ -9,12 +9,11 @@
...
@@ -9,12 +9,11 @@
%a
.gutter-toggle.pull-right.js-sidebar-toggle
{
role:
"button"
,
href:
"#"
,
aria:
{
label:
"Toggle sidebar"
}
}
%a
.gutter-toggle.pull-right.js-sidebar-toggle
{
role:
"button"
,
href:
"#"
,
aria:
{
label:
"Toggle sidebar"
}
}
=
sidebar_gutter_toggle_icon
=
sidebar_gutter_toggle_icon
-
if
current_user
-
if
current_user
%button
.btn.btn-default.issuable-header-btn.pull-right.js-issuable-todo
{
type:
"button"
,
data:
{
todo_text:
"Add Todo"
,
mark_text:
"Mark Done"
,
id:
(
todo
.
id
unless
todo
.
nil?
),
url:
issuable_todo_path
(
issuable
)
}
}
%button
.btn.btn-default.issuable-header-btn.pull-right.js-issuable-todo
{
type:
"button"
,
aria:
{
label:
(
todo
.
nil?
?
"Add Todo"
:
"Mark Done"
)
},
data:
{
todo_text:
"Add Todo"
,
mark_text:
"Mark Done"
,
id:
(
todo
.
id
unless
todo
.
nil?
),
url:
issuable_todo_path
(
issuable
)
}
}
%span
.js-issuable-todo-text
-
if
todo
.
nil?
-
if
todo
.
nil?
%span
Add Todo
Add Todo
-
else
-
else
%span
Mark Done
Mark Done
=
icon
(
'spin spinner'
,
class:
'hidden js-issuable-todo-loading'
)
=
icon
(
'spin spinner'
,
class:
'hidden js-issuable-todo-loading'
)
...
...
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