Merge pull request #791 from jcalado/master

Hotkey: Alt-Shift-C to toggle control bar
This commit is contained in:
Steve Seguin 2021-03-24 09:51:16 -04:00 committed by GitHub
commit cf4959c6db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;