Quellcode durchsuchen

:bug: fix https://github.com/Vanessa219/vditor/pull/292

Liyuan Li vor 5 Jahren
Ursprung
Commit
6a725108fb
3 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 1 0
      CHANGELOG.md
  2. 1 1
      src/ts/ui/initUI.ts
  3. 1 1
      src/ts/util/compatibility.ts

+ 1 - 0
CHANGELOG.md

@@ -59,6 +59,7 @@
 
 ### v3.1.4 / 2020-04-0x
 
+* [292](https://github.com/Vanessa219/vditor/pull/292) 🐛 全屏模式文末空白 `修复缺陷`
 * [293](https://github.com/Vanessa219/vditor/issues/293) iOS Safari 快捷键显示为 Windows 版本 `修复缺陷`
 * [290](https://github.com/Vanessa219/vditor/pull/290) 🎨 add minHeight `改进功能`
 

+ 1 - 1
src/ts/ui/initUI.ts

@@ -76,7 +76,7 @@ const afterRender = (vditor: IVditor, contentElement: HTMLElement) => {
     if (vditor.options.typewriterMode) {
         let height: number = window.innerHeight - 37;
         if (typeof vditor.options.height === "number") {
-            height = vditor.options.height - 37;
+            height = Math.min(window.innerHeight, vditor.options.height) - 37;
         }
         // 由于 Firefox padding-bottom bug,只能使用 :after
         contentElement.style.setProperty("--editor-bottom", height / 2 + "px");

+ 1 - 1
src/ts/util/compatibility.ts

@@ -42,7 +42,7 @@ export const isCtrl = (event: KeyboardEvent) => {
 
 // Mac,Windows 快捷键展示
 export const updateHotkeyTip = (hotkey: string) => {
-    if (/Mac/.test(navigator.platform) || navigator.platform === 'iPhone') {
+    if (/Mac/.test(navigator.platform) || navigator.platform === "iPhone") {
         hotkey = hotkey.replace("ctrl", "⌘").replace("shift", "⇧")
             .replace("alt", "⌥");
         if (hotkey.indexOf("⇧") > -1) {