1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Open form to a new window on Ctrl+click or Shift+click

This commit is contained in:
Jakub Vrana
2012-09-04 15:40:57 -07:00
parent 541561be4d
commit 4cb14deac1
3 changed files with 16 additions and 1 deletions

View File

@@ -312,6 +312,20 @@ function bodyKeydown(event, button) {
return true;
}
/** Open form to a new window on Ctrl+click or Shift+click
* @param MouseEvent
*/
function bodyClick(event) {
var target = event.target || event.srcElement;
if ((event.ctrlKey || event.shiftKey) && target.type == 'submit' && /input/i.test(target.tagName)) {
target.form.target = '_blank';
setTimeout(function () {
// if (event.ctrlKey) { focus(); } doesn't work
target.form.target = '';
}, 0);
}
}
/** Change focus by Ctrl+Up or Ctrl+Down