summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/projects.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/projects.js')
-rw-r--r--app/assets/javascripts/projects.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/app/assets/javascripts/projects.js b/app/assets/javascripts/projects.js
new file mode 100644
index 00000000000..dc13d006077
--- /dev/null
+++ b/app/assets/javascripts/projects.js
@@ -0,0 +1,41 @@
+$(document).ready(function(){
+ $('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live("click", function() {
+ history.pushState({ path: this.path }, '', this.href)
+ })
+
+ $("#tree-slider tr.tree-item").live('click', function(e){
+ if(e.target.nodeName != "A") {
+ e.stopPropagation();
+ $(this).find("td.tree-item-file-name a").click();
+ return false;
+ }
+ });
+
+ $("#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();
+}