Hello,
Is there a keyboard shortcut to switch between tabs? Like ctrl + left would move to the next tab on an edit screen and ctrl + right to the previous one.
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
switch tab with keyboard
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: switch tab with keyboard
Hi,
Ctrl-left-arrow and Ctrl-right-arrow are already used to skip to the next or previous word. Therefore I'd rather use the ctrl+shift+left-arrow and ctrl+shift+right-arrow combinations.
Add this Javascript code in the Header under Home ► Setup
Ctrl-left-arrow and Ctrl-right-arrow are already used to skip to the next or previous word. Therefore I'd rather use the ctrl+shift+left-arrow and ctrl+shift+right-arrow combinations.
Add this Javascript code in the Header under Home ► Setup
Code: Select all
function initNextTabShortcuts() {
// Ctrl + Left | Ctrl + Right Keypress -> Move to previous/next tab
document.onkeydown = function(e) {
e = e || window.event;
var keyCode = e.keyCode || e.which,
arrow = {left: 37, right: 39};
if(nuFormType() == 'edit'){
if (e.ctrlKey && e.shiftKey) {
switch (keyCode) {
case arrow.left:
selectNextTab(-1);
break;
case arrow.right:
selectNextTab(1);
break;
}
}
}
}
function selectNextPrevTab(i) {
var selectedTab = $('.nuTabSelected')[0].id.substring(5);
var nextTab = parseInt(selectedTab) + i;
var e = document.getElementById('nuTab' + nextTab);
if(e != null) {
nuSelectTab(e);
}
}
function nuOnLoad() {
initNextPrevTabShortcuts();
}