diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-12-20 10:24:14 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2011-12-20 10:24:14 +0400 |
commit | cff951912734a5aeea0ebb3e4ca01f704004a466 (patch) | |
tree | 38e064b2551458052f7962efa615c2e4e0b4075c /app/assets/javascripts/application.js | |
parent | 6d5c9698726e268a9cd392a5782c055031bb1bb9 (diff) |
Dashboard perfomance improved. Filter for projects page
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"}); } |