diff --git a/qt/aqt/data/web/css/editor.scss b/qt/aqt/data/web/css/editor.scss index c1bff5cf0..dc65c3e6a 100644 --- a/qt/aqt/data/web/css/editor.scss +++ b/qt/aqt/data/web/css/editor.scss @@ -34,12 +34,10 @@ body { } #topbutsOuter { - position: fixed; + position: sticky; top: 0; - padding: 2px; left: 0; - right: 0; - z-index: 1; + padding: 2px; } .topbut { @@ -94,10 +92,6 @@ button.highlighted { } } -#fields { - margin-top: 35px; -} - .dupe { background: var(--flag1-bg); } diff --git a/qt/aqt/data/web/js/editor.ts b/qt/aqt/data/web/js/editor.ts index 85483078c..a22b699ed 100644 --- a/qt/aqt/data/web/js/editor.ts +++ b/qt/aqt/data/web/js/editor.ts @@ -606,31 +606,3 @@ let filterNode = function (node: Node, extendedMode: boolean): void { } } }; - -let adjustFieldsTopMargin = function (): void { - const topHeight = $("#topbuts").height(); - const margin = topHeight + 8; - document.getElementById("fields").style.marginTop = `${margin}px`; -}; - -document.addEventListener("click", (evt: MouseEvent): void => { - const src = evt.target as Element; - if (src.tagName === "IMG") { - // image clicked; find contenteditable parent - let p = src; - while ((p = p.parentNode as Element)) { - if (p.className === "field") { - document.getElementById(p.id).focus(); - break; - } - } - } -}); - -window.addEventListener("resize", () => { - adjustFieldsTopMargin(); -}); - -$(function (): void { - adjustFieldsTopMargin(); -}); diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 342bdb877..3abe0ca70 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -74,12 +74,14 @@ _html = """ html { background: %s; } #topbutsOuter { background: %s; } -
-
-%s +
+
+
+ %s +
+
+
-
-