diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-29 13:16:30 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-05-29 13:16:30 +0300 |
commit | 04cc6dd67a6117e97c328396dedbf69f40d7e330 (patch) | |
tree | 86b552249e0803973ec0cb3f98124ec62afa28a6 /app | |
parent | 003f18c2a686f52781b6b39cb8e7e86de406a5a6 (diff) | |
download | gitlab-ce-04cc6dd67a6117e97c328396dedbf69f40d7e330.tar.gz |
Assign to me link on issue form
Diffstat (limited to 'app')
-rw-r--r-- | app/views/issues/_form.html.haml | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index b32d9192afc..2bb5e6ca5ac 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -19,7 +19,9 @@ = f.label :assignee_id do %i.icon-user Assign to - .input= f.select(:assignee_id, @project.users.alphabetically.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'}) + .input + = f.select(:assignee_id, @project.users.alphabetically.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'}) + = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' .issue_milestone.pull-left = f.label :milestone_id do %i.icon-time @@ -55,31 +57,33 @@ :javascript - $(function(){ - $("#issue_label_list") - .bind( "keydown", function( event ) { - if ( event.keyCode === $.ui.keyCode.TAB && - $( this ).data( "autocomplete" ).menu.active ) { - event.preventDefault(); - } - }) - .autocomplete({ - minLength: 0, - source: function( request, response ) { - response( $.ui.autocomplete.filter( - #{raw labels_autocomplete_source}, extractLast( request.term ) ) ); - }, - focus: function() { - return false; - }, - select: function(event, ui) { - var terms = split( this.value ); - terms.pop(); - terms.push( ui.item.value ); - terms.push( "" ); - this.value = terms.join( ", " ); - return false; - } - }); - }); + $("#issue_label_list") + .bind( "keydown", function( event ) { + if ( event.keyCode === $.ui.keyCode.TAB && + $( this ).data( "autocomplete" ).menu.active ) { + event.preventDefault(); + } + }) + .autocomplete({ + minLength: 0, + source: function( request, response ) { + response( $.ui.autocomplete.filter( + #{raw labels_autocomplete_source}, extractLast( request.term ) ) ); + }, + focus: function() { + return false; + }, + select: function(event, ui) { + var terms = split( this.value ); + terms.pop(); + terms.push( ui.item.value ); + terms.push( "" ); + this.value = terms.join( ", " ); + return false; + } + }); + $('.assign-to-me-link').on('click', function(e){ + $('#issue_assignee_id').val("#{current_user.id}").trigger("liszt:updated"); + e.preventDefault(); + }); |