diff options
author | Jacob Schatz <jacobschatz@Jacobs-MacBook-Pro.local> | 2016-03-26 18:43:42 +0300 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-03-30 14:26:09 +0300 |
commit | cb6192986a40ab35566bfd8d76f8ffd23ef4d0ab (patch) | |
tree | 12316c5580e8f54a79b930e1409eb22ca03872be /app/assets/javascripts/users_select.js.coffee | |
parent | 7b2af8740dfa080bcb880fef64de4b99e2255dd4 (diff) |
Make changed values visible in minimized sidebar.
Diffstat (limited to 'app/assets/javascripts/users_select.js.coffee')
-rw-r--r-- | app/assets/javascripts/users_select.js.coffee | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/app/assets/javascripts/users_select.js.coffee b/app/assets/javascripts/users_select.js.coffee index aec13e54c98..1ed552270a6 100644 --- a/app/assets/javascripts/users_select.js.coffee +++ b/app/assets/javascripts/users_select.js.coffee @@ -19,6 +19,7 @@ class @UsersSelect $block = $selectbox.closest('.block') abilityName = $dropdown.data('ability-name') $value = $block.find('.value') + $collapsedSidebar = $block.find('.sidebar-collapsed-user') $loading = $block.find('.block-loading').fadeOut() $block.on('click', '.js-assign-yourself', (e) => @@ -51,11 +52,21 @@ class @UsersSelect name: 'Unassigned' username: '' avatar: '' + $value.html(assigneeTemplate(user)) + $collapsedSidebar.html(collapsedAssigneeTemplate(user)) + + collapsedAssigneeTemplate = _.template( + '<% if( avatar ) { %> + <a class="author_link" href="/u/<%= username %>"> + <img width="24" class="avatar avatar-inline s24" alt="" src="<%= avatar %>"> + <span class="author">Toni Boehm</span> + </a> + <% } else { %> + <i class="fa fa-user"></i> + <% } %>' + ) - $value.html(noAssigneeTemplate(user)) - $value.find('a').attr('href') - - noAssigneeTemplate = _.template( + assigneeTemplate = _.template( '<% if (username) { %> <a class="author_link " href="/u/<%= username %>"> <% if( avatar ) { %> @@ -131,7 +142,8 @@ class @UsersSelect hidden: (e) -> $selectbox.hide() - $value.show() + # display:block overrides the hide-collapse rule + $value.removeAttr('style') clicked: (user) -> page = $('body').data 'page' |