diff --git a/aqt/editor.py b/aqt/editor.py
index 8472e0a51..e12982480 100644
--- a/aqt/editor.py
+++ b/aqt/editor.py
@@ -35,7 +35,7 @@ _html = """
html { background: %s; }
#topbuts { background: %s; }
-
%s
+
"""
diff --git a/web/editor.css b/web/editor.css
index 1e3d588d2..c8ff0d979 100644
--- a/web/editor.css
+++ b/web/editor.css
@@ -6,13 +6,10 @@
overflow-wrap: break-word;
}
-/* prevent floated images from being displayed outside field */
-.field:after {
+.clearfix:after {
content: "";
- display: block;
- height: 0;
+ display: table;
clear: both;
- visibility: hidden;
}
.fname {
@@ -28,7 +25,7 @@ body {
margin: 5px;
}
-#topbuts {
+#topbutsOuter {
position: fixed;
height: 24px;
top: 0;
@@ -40,6 +37,7 @@ body {
.topbut {
width: 16px;
height: 16px;
+ margin-top: 4px;
}
.rainbow {
diff --git a/web/editor.js b/web/editor.js
index a4f36056c..af950904e 100644
--- a/web/editor.js
+++ b/web/editor.js
@@ -297,7 +297,7 @@ function setFields(fields) {
}
txt += "{0} |
".format(n);
txt += " {0} ".format(f);
@@ -448,6 +448,12 @@ var filterNode = function (node, extendedMode) {
}
};
+var adjustFieldsTopMargin = function() {
+ var topHeight = $("#topbuts").height();
+ var margin = topHeight + 8;
+ document.getElementById("fields").style.marginTop = margin + "px";
+};
+
var mouseDown = 0;
$(function () {
@@ -477,4 +483,10 @@ $(function () {
$("button.linkb").on("mousedown", function (e) {
e.preventDefault();
});
+
+ window.onresize = function() {
+ adjustFieldsTopMargin();
+ };
+
+ adjustFieldsTopMargin();
});
|