diff options
author | David Cabo <david@calibea.com> | 2011-09-07 01:39:08 +0200 |
---|---|---|
committer | David Cabo <david@calibea.com> | 2011-09-07 01:39:08 +0200 |
commit | 9e9cd41feec32715e948eb4ec90dc8db44412aad (patch) | |
tree | 7df39837e7bcfa8ee14477c2930b17398c5977eb | |
parent | f5d09ce293aed6bee1d92761f3cfd8a651492ca2 (diff) |
Use new tab/window when following links in request typeahead search
-rw-r--r-- | app/views/request/new.rhtml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index 9adf5d383..4301d639a 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -4,7 +4,10 @@ // Avoid triggering too often (on each keystroke) by using the debounce jQuery plugin: // http://benalman.com/projects/jquery-throttle-debounce-plugin/ $("#typeahead_search").keypress($.debounce( 300, function() { - $("#typeahead_response").load("<%=search_ahead_url%>?q="+encodeURI(this.value)); + $("#typeahead_response").load("<%=search_ahead_url%>?q="+encodeURI(this.value), function() { + // When following links in typeahead results, open new tab/window + $("#typeahead_response a").attr("target","_blank"); + }); })); }); </script> |