User selection from collapsed sidebar
This commit is contained in:
parent
750cd5c0e0
commit
697895676f
1 changed files with 17 additions and 0 deletions
|
@ -17,6 +17,9 @@ class @UsersSelect
|
||||||
issueURL = $dropdown.data('issueUpdate')
|
issueURL = $dropdown.data('issueUpdate')
|
||||||
$selectbox = $dropdown.closest('.selectbox')
|
$selectbox = $dropdown.closest('.selectbox')
|
||||||
$block = $selectbox.closest('.block')
|
$block = $selectbox.closest('.block')
|
||||||
|
$gutterToggle = $block
|
||||||
|
.closest('aside')
|
||||||
|
.find('.gutter-toggle')
|
||||||
abilityName = $dropdown.data('ability-name')
|
abilityName = $dropdown.data('ability-name')
|
||||||
$value = $block.find('.value')
|
$value = $block.find('.value')
|
||||||
$collapsedSidebar = $block.find('.sidebar-collapsed-user')
|
$collapsedSidebar = $block.find('.sidebar-collapsed-user')
|
||||||
|
@ -27,6 +30,16 @@ class @UsersSelect
|
||||||
assignTo(@currentUser.id)
|
assignTo(@currentUser.id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
$block.on('click', '.author_link', (e) =>
|
||||||
|
e.preventDefault()
|
||||||
|
$gutterToggle
|
||||||
|
.trigger('click')
|
||||||
|
$block
|
||||||
|
.find('.edit-link')
|
||||||
|
.trigger('click')
|
||||||
|
$block.addClass('collapse-after-update')
|
||||||
|
)
|
||||||
|
|
||||||
assignTo = (selected) ->
|
assignTo = (selected) ->
|
||||||
data = {}
|
data = {}
|
||||||
data[abilityName] = {}
|
data[abilityName] = {}
|
||||||
|
@ -54,6 +67,10 @@ class @UsersSelect
|
||||||
avatar: ''
|
avatar: ''
|
||||||
$value.html(assigneeTemplate(user))
|
$value.html(assigneeTemplate(user))
|
||||||
$collapsedSidebar.html(collapsedAssigneeTemplate(user))
|
$collapsedSidebar.html(collapsedAssigneeTemplate(user))
|
||||||
|
if $block.hasClass('collapse-after-update')
|
||||||
|
$block.removeClass('collapse-after-update')
|
||||||
|
$gutterToggle.trigger('click')
|
||||||
|
|
||||||
|
|
||||||
collapsedAssigneeTemplate = _.template(
|
collapsedAssigneeTemplate = _.template(
|
||||||
'<% if( avatar ) { %>
|
'<% if( avatar ) { %>
|
||||||
|
|
Loading…
Reference in a new issue