Commit 05525b55 authored by Phil Hughes's avatar Phil Hughes

Fixed issue with todo button not updating state

This would happen when a todo already exists, the state of the button
wouldn't update after the ajax call
parent 82be673b
...@@ -70,18 +70,18 @@ class @Sidebar ...@@ -70,18 +70,18 @@ class @Sidebar
$('.js-issuable-todo-loading').addClass 'hidden' $('.js-issuable-todo-loading').addClass 'hidden'
if data.count is 0 if data.count is 0
$this.removeAttr 'data-id'
$btnText.text $this.data('todo-text')
$todoPendingCount $todoPendingCount
.addClass 'hidden' .addClass 'hidden'
else else
$btnText.text $this.data('mark-text')
$todoPendingCount $todoPendingCount
.removeClass 'hidden' .removeClass 'hidden'
if data.todo? if data.todo?
$btnText.text $this.data('mark-text')
$this.attr 'data-id', data.todo.id $this.attr 'data-id', data.todo.id
else
$this.removeAttr 'data-id'
$btnText.text $this.data('todo-text')
sidebarDropdownLoading: (e) -> sidebarDropdownLoading: (e) ->
$sidebarCollapsedIcon = $(@).closest('.block').find('.sidebar-collapsed-icon') $sidebarCollapsedIcon = $(@).closest('.block').find('.sidebar-collapsed-icon')
......
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
} }
} }
a:not(.issuable-header-btn) { a {
&:hover { &:hover {
color: $md-link-color; color: $md-link-color;
text-decoration: none; text-decoration: none;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment