alt+shift+c to toggle the control bar

This commit is contained in:
Joel Calado 2021-03-23 22:27:31 +00:00
parent 055c4652ae
commit 68923a2462

18
main.js
View File

@ -10649,11 +10649,14 @@ var vis = (function() {
}
function keyupListener() {
// window.onkeyup = function(e) {
window.onkeyup = function(e) {
// if ( e.keyCode === 27 ) {
// toggleMenuOff();
// }
// };
if (e.altKey && e.shiftKey && e.keyCode === 67 /* C */) {
toggleControlBar();
}
};
}
function resizeListener() {
@ -10676,6 +10679,17 @@ var vis = (function() {
}
}
function toggleControlBar() {
if (getById("controlButtons").style.display != 'none') {
// Dont hardcode style here. Copy it over to data-style before changing to none;
getById("controlButtons").dataset.style = getById("controlButtons").style.display;
getById("controlButtons").style.display = 'none';
} else {
// Copy the style over from the data-style attribute.
getById("controlButtons").style.display = getById("controlButtons").dataset.style;
};
}
function positionMenu(e) {
clickCoords = getPosition(e);
clickCoordsX = clickCoords.x;