diff options
author | Jacob Schatz <jacobschatz@Jacobs-MacBook-Pro.local> | 2016-03-26 19:43:08 +0300 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-03-30 14:26:09 +0300 |
commit | 697895676f7811dd5b185aed1676dd02563f928e (patch) | |
tree | 05fc8ffcf23a701728ddb5dd1df9c935685f9a19 /app/assets/javascripts/users_select.js.coffee | |
parent | 750cd5c0e0a7c8d911f44caa9bf6950b0018dee5 (diff) |
User selection from collapsed sidebar
Diffstat (limited to 'app/assets/javascripts/users_select.js.coffee')
-rw-r--r-- | app/assets/javascripts/users_select.js.coffee | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/assets/javascripts/users_select.js.coffee b/app/assets/javascripts/users_select.js.coffee index 1ed552270a6..a25836a140a 100644 --- a/app/assets/javascripts/users_select.js.coffee +++ b/app/assets/javascripts/users_select.js.coffee @@ -17,6 +17,9 @@ class @UsersSelect issueURL = $dropdown.data('issueUpdate') $selectbox = $dropdown.closest('.selectbox') $block = $selectbox.closest('.block') + $gutterToggle = $block + .closest('aside') + .find('.gutter-toggle') abilityName = $dropdown.data('ability-name') $value = $block.find('.value') $collapsedSidebar = $block.find('.sidebar-collapsed-user') @@ -27,6 +30,16 @@ class @UsersSelect 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) -> data = {} data[abilityName] = {} @@ -54,6 +67,10 @@ class @UsersSelect avatar: '' $value.html(assigneeTemplate(user)) $collapsedSidebar.html(collapsedAssigneeTemplate(user)) + if $block.hasClass('collapse-after-update') + $block.removeClass('collapse-after-update') + $gutterToggle.trigger('click') + collapsedAssigneeTemplate = _.template( '<% if( avatar ) { %> |