diff options
Diffstat (limited to 'app/assets/javascripts/application.js')
-rw-r--r-- | app/assets/javascripts/application.js | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 93dbd7dd19c..04d4f0bc6cf 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -16,7 +16,7 @@ //= require branch-graph //= require_tree . -$(function(){ +$(document).ready(function(){ $(".one_click_select").live("click", function(){ $(this).select(); }); @@ -27,8 +27,50 @@ $(function(){ $(".account-box").mouseenter(showMenu); $(".account-box").mouseleave(resetMenu); + $("#projects-list .project").live('click', function(e){ + if(e.target.nodeName != "A" && e.target.nodeName != "INPUT") { + location.href = $(this).attr("url"); + e.stopPropagation(); + return false; + } + }); + + $("#issues-table .issue").live('click', function(e){ + if(e.target.nodeName != "A" && e.target.nodeName != "INPUT") { + location.href = $(this).attr("url"); + e.stopPropagation(); + return false; + } + }); + + $(document).keypress(function(e) { + if( $(e.target).is(":input") ) return; + switch(e.which) { + case 115: focusSearch(); + e.preventDefault(); + } + }); + }); +function focusSearch() { + $("#search").focus(); +} + +function taggifyForm(){ + var tag_field = $('#tag_field').tagify(); + + tag_field.tagify('inputField').autocomplete({ + source: '/tags.json' + }); + + $('form').submit( function() { + var tag_field = $('#tag_field') + tag_field.val( tag_field.tagify('serialize') ); + return true; + }); +} + function updatePage(data){ $.ajax({type: "GET", url: location.href, data: data, dataType: "script"}); } |