manager: open in new tab on ctrl/middle-click on row (#45339)

This commit is contained in:
Frédéric Péters 2020-07-25 15:53:55 +02:00
parent b64232ff54
commit 292f990953
1 changed files with 8 additions and 1 deletions

View File

@ -172,8 +172,15 @@
}
});
$(document).on('click.manager', 'table tr[data-url][rel=popup]', displayPopup);
$(document).on('click.manager', 'table tr[data-url]:not([rel=popup])', function (e) {
$(document).on('mouseup.manager', 'table tr[data-url]:not([rel=popup])', function (e) {
var $target = $(event.target);
if ($target.is('a')) return false;
if (e.which == 2 || e.ctrlKey) {
window.open($(this).data('url'), '_blank');
} else {
window.location.href = $(this).data('url');
}
return true;
});
/* Prepopulate slug fields */
$('#id_slug').data('_changed', false);