Merge pull request #1134 from Ana06/all-events-links

Make links inside event-panel work with ctrl+click
This commit is contained in:
Christian Bruckmayer 2017-01-09 17:54:30 +01:00 committed by GitHub
commit 5f080cf6db
2 changed files with 26 additions and 12 deletions

View file

@ -116,3 +116,28 @@ $(document).ready( function() {
}
});
});
function eventClicked(e, element){
var url = $(element).data('url');
if(e.ctrlKey)
window.open(url,'_blank');
else
window.location = url;
}
/* Links inside event-panel (to make ctrl + click work for these links):
= link_to text, '#', onClick: 'insideLinkClicked();', 'data-url' => url
*/
function insideLinkClicked(event){
// stops the click from propagating
if (!event) // for IE
var event = window.event;
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
var url = $(event.target).data('url');
if(event.ctrlKey)
window.open(url,'_blank');
else
window.location = url;
}