Skip to content

Commit

Permalink
everywhere there is a hover canvas I need to do the same to ruler-canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonturner committed Oct 25, 2024
1 parent 039bb7c commit d834ce3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions metro_map_saver/map_saver/static/js/metromapmaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2648,6 +2648,7 @@ function disableRightClick(event) {
function enableRightClick() {
document.getElementById('grid-canvas').removeEventListener('contextmenu', disableRightClick);
document.getElementById('hover-canvas').removeEventListener('contextmenu', disableRightClick);
document.getElementById('ruler-canvas').removeEventListener('contextmenu', disableRightClick);
} // enableRightClick()

function getCanvasXY(pageX, pageY) {
Expand Down Expand Up @@ -2850,6 +2851,7 @@ function downloadImage(canvas, showImg) {
if (showImg) {
$('#grid-canvas').hide();
$('#hover-canvas').hide();
$('#ruler-canvas').hide();
$('#metro-map-canvas').hide();
$('#metro-map-stations-canvas').hide();
$('#metro-map-image').attr('src', imageData)
Expand All @@ -2872,6 +2874,7 @@ function downloadImage(canvas, showImg) {
if (showImg) {
$('#grid-canvas').hide();
$('#hover-canvas').hide();
$('#ruler-canvas').hide();
$('#metro-map-canvas').hide();
$('#metro-map-stations-canvas').hide();
$('#metro-map-image').attr('src', pngUrl)
Expand Down Expand Up @@ -3041,6 +3044,7 @@ $(document).ready(function() {
// Disable right-click on the grid/hover canvases (but not on the map canvas/image)
document.getElementById('grid-canvas').addEventListener('contextmenu', disableRightClick);
document.getElementById('hover-canvas').addEventListener('contextmenu', disableRightClick);
document.getElementById('ruler-canvas').addEventListener('contextmenu', disableRightClick);

// Enable the tooltips
$(function () {
Expand Down Expand Up @@ -3535,6 +3539,7 @@ $(document).ready(function() {
if ($('#grid-canvas').is(':visible')) {
$('#grid-canvas').hide();
$('#hover-canvas').hide();
$('#ruler-canvas').hide();
$('#metro-map-canvas').hide();
$('#metro-map-stations-canvas').hide();
var canvas = document.getElementById('metro-map-canvas');
Expand All @@ -3553,6 +3558,7 @@ $(document).ready(function() {
} else {
$('#grid-canvas').show();
$('#hover-canvas').show();
$('#ruler-canvas').show();
$('#metro-map-canvas').show();
$('#metro-map-stations-canvas').show();
$("#metro-map-image").hide();
Expand Down Expand Up @@ -4521,6 +4527,7 @@ function editOnSmallScreen() {
}
$('#grid-canvas').show();
$('#hover-canvas').show();
$('#ruler-canvas').show();
$('#metro-map-canvas').show();
$('#metro-map-stations-canvas').show();
$('#metro-map-image').hide()
Expand Down
2 changes: 1 addition & 1 deletion metro_map_saver/map_saver/static/js/metromapmaker.min.js

Large diffs are not rendered by default.

0 comments on commit d834ce3

Please sign in to comment.