Merge pull request #582 from ChrisBr/fix71

Events open now in new tab when clicking in schedule
This commit is contained in:
Christian Bruckmayer 2015-01-21 15:14:19 +01:00
commit 8e25338436

View file

@ -97,13 +97,19 @@
<%= javascript_tag do %> <%= javascript_tag do %>
jQuery( function($) { jQuery( function($) {
$('tbody tr td[data-href]').addClass('clickable').mouseup(function(e) { $('tbody tr td[data-href]').addClass('clickable').mouseup(function(e) {
if(e.which===1) var url = $(this).attr('data-href');
{ if (e.which === 1 && e.ctrlKey){
window.location = $(this).attr('data-href'); var win = window.open(url, '_blank');
win.focus();
} }
else if(e.which===2) else if(e.which === 1)
{ {
window.open($(this).attr('data-href'), '_blank'); window.location = url;
}
else if(e.which === 2)
{
var win = window.open(url, '_blank');
win.focus();
} }
}); });
}); });