From 98fd516b5b7e01ff10dd105f823562e9cba53ab6 Mon Sep 17 00:00:00 2001 From: balen Date: Wed, 4 Sep 2024 14:52:41 -0400 Subject: [PATCH] Fixes for zoom issue and assets --- app/javascript/entrypoints/select2js.js | 3 --- app/views/shared/_transcriber_app.html.erb | 20 ++++++++++++++------ yarn.lock | 12 ++++++++++++ 3 files changed, 26 insertions(+), 9 deletions(-) delete mode 100644 app/javascript/entrypoints/select2js.js diff --git a/app/javascript/entrypoints/select2js.js b/app/javascript/entrypoints/select2js.js deleted file mode 100644 index ed64fa33..00000000 --- a/app/javascript/entrypoints/select2js.js +++ /dev/null @@ -1,3 +0,0 @@ -import 'select2/dist/css/select2.css'; -import 'select2-bootstrap-theme/dist/select2-bootstrap.css'; -import "@/utils/select2.full.js"; diff --git a/app/views/shared/_transcriber_app.html.erb b/app/views/shared/_transcriber_app.html.erb index 41d87772..de5d6b4f 100644 --- a/app/views/shared/_transcriber_app.html.erb +++ b/app/views/shared/_transcriber_app.html.erb @@ -197,12 +197,20 @@ var zoom = (percent ? (value / 100) : value); if (zoom > 0.1) { - this.zoomContainer.find(".annotated_page").css({ - zoom : zoom, - // handle zoom css for firefox - '-moz-transform' : ('scale(' + zoom + ')'), - '-moz-transform-origin' : 'left top' - }); + const browser = Bowser.getParser(window.navigator.userAgent); + // console.debug("****** browser IS", browser.getEngineName()); + if (browser.getEngineName() == 'Gecko') { + // If the agent is FF then we need to use the moz-transform + // AND not put in the zoom + this.zoomContainer.find(".annotated_page").css({ + '-moz-transform' : ('scale(' + zoom + ')'), + '-moz-transform-origin' : 'top left' + }); + } else { + this.zoomContainer.find(".annotated_page").css({ + zoom : zoom + }); + } this.currentZoom = zoom; this.updateZoomLevel(); diff --git a/yarn.lock b/yarn.lock index 6d986d49..7b9a341f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -164,6 +164,11 @@ source-map "0.6.1" unplugin "^1.1.0" +"@jridgewell/sourcemap-codec@^1.4.13": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + "@jridgewell/sourcemap-codec@^1.4.15": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" @@ -851,6 +856,13 @@ luxon@^3.1.0: resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.4.4.tgz#cf20dc27dc532ba41a169c43fdcc0063601577af" integrity sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA== +magic-string@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" + integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.13" + magic-string@^0.30.0, magic-string@^0.30.10: version "0.30.10" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.10.tgz#123d9c41a0cb5640c892b041d4cfb3bd0aa4b39e"