diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-21 14:20:21 +0300 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-03-25 16:54:05 +0300 |
commit | 139c255a929596a722c2c394a4650381feab34c8 (patch) | |
tree | ed50fed67d81ff02abbeb9358c4d98c409c210ee /app/assets/javascripts/users_select.js.coffee | |
parent | cf0c6e87eabcc637a145d1bc7fc89c914e7c0781 (diff) |
Fixed JS error that was failing the builds
Diffstat (limited to 'app/assets/javascripts/users_select.js.coffee')
-rw-r--r-- | app/assets/javascripts/users_select.js.coffee | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/assets/javascripts/users_select.js.coffee b/app/assets/javascripts/users_select.js.coffee index 76eb2b1d696..99322ffd807 100644 --- a/app/assets/javascripts/users_select.js.coffee +++ b/app/assets/javascripts/users_select.js.coffee @@ -2,7 +2,8 @@ class @UsersSelect constructor: (currentUser) -> @usersPath = "/autocomplete/users.json" @userPath = "/autocomplete/users/:id.json" - @currentUser = JSON.parse(currentUser) + if currentUser? + @currentUser = JSON.parse(currentUser) $('.js-user-search').each (i, dropdown) => $dropdown = $(dropdown) @@ -20,7 +21,7 @@ class @UsersSelect $value = $block.find('.value') $loading = $block.find('.block-loading').fadeOut() - $block.on('click','.js-assign-yourself' , (e) => + $block.on('click', '.js-assign-yourself', (e) => e.preventDefault() assignTo(@currentUser.id) ) @@ -39,7 +40,7 @@ class @UsersSelect ).done (data) -> $loading.fadeOut() $selectbox.hide() - + if data.assignee user = name: data.assignee.name @@ -67,7 +68,7 @@ class @UsersSelect </a> <% } else { %> <span class="assign-yourself"> - No assignee - + No assignee - <a href="#" class="js-assign-yourself"> assign yourself </a> @@ -175,7 +176,7 @@ class @UsersSelect listClosingTags = "</a> </li>" - + if username is '' listWithUserName = '' |