mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Merge pull request #1134 from Ana06/all-events-links
Make links inside event-panel work with ctrl+click
This commit is contained in:
commit
5f080cf6db
2 changed files with 26 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue