From d673f413be59cb6f8f81c0575b3d8c1bb54a1d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Tue, 9 Nov 2021 21:07:22 +0100 Subject: [PATCH] mermaid: add visual hints for pan/zoom #143 --- static/css/theme.css | 8 +++++++- static/js/jquery.svg.pan.zoom.js | 10 ++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/static/css/theme.css b/static/css/theme.css index cf37788d14..b9136bc865 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -1074,10 +1074,16 @@ option { margin-top: 1.7rem; } -.mermaid svg { +.mermaid > svg { + border: 1px solid transparent; + cursor: pointer; /* remove inline height from generated diagram */ height: initial !important; } +.mermaid > svg:hover { + border-color: #ccc; +} + .include.hide-first-heading h1:first-of-type, .include.hide-first-heading h2:first-of-type, diff --git a/static/js/jquery.svg.pan.zoom.js b/static/js/jquery.svg.pan.zoom.js index b78ac3cab7..bd6a10c449 100644 --- a/static/js/jquery.svg.pan.zoom.js +++ b/static/js/jquery.svg.pan.zoom.js @@ -1,7 +1,9 @@ // Generated by CoffeeScript 1.10.0 /* -jQuery SVG Pan Zoom v1.0.2, June 2015 +Base: jQuery SVG Pan Zoom v1.0.3, October 2015 (labeled v1.0.2, June 2015) +McShelby.hugo-theme-relearn: +Change 1: OnMouseUp restore image cursor (not document cursor) Author: Daniel Hoffmann Bernardes (daniel.hoffmann.bernardes@gmail.com) @@ -579,9 +581,9 @@ Copyright (C) 2014 Daniel Hoffmann Bernardes, Ícaro Technologies initialViewBox = $.extend({}, viewBox); $body = $(window.document.body); domBody = $body[0]; - oldCursor = $body.css("cursor"); + oldCursor = this.$svg.css("cursor"); if (this.events.dragCursor != null) { - $body.css("cursor", this.events.dragCursor); + this.$svg.css("cursor", this.events.dragCursor); } mouseMoveCallback = (function(ev2) { var currentMousePosition, initialMousePosition; @@ -607,7 +609,7 @@ Copyright (C) 2014 Daniel Hoffmann Bernardes, Ícaro Technologies domBody.removeEventListener("touchcancel", mouseUpCallback, true); domBody.removeEventListener("mouseout", mouseUpCallback, true); if (this.events.dragCursor != null) { - $body.css("cursor", oldCursor); + this.$svg.css("cursor", oldCursor); } dragStarted = false; }).bind(opts);