Liyuan Li 5 years ago
parent
commit
63e84724cd
4 changed files with 37 additions and 2 deletions
  1. 1 0
      CHANGELOG.md
  2. 16 0
      src/assets/scss/_ir.scss
  3. 17 0
      src/assets/scss/_wysiwyg.scss
  4. 3 2
      src/ts/ui/initUI.ts

+ 1 - 0
CHANGELOG.md

@@ -66,6 +66,7 @@
 
 
 ### v3.2.3 / 2020-05-0x
 ### v3.2.3 / 2020-05-0x
 
 
+* [383](https://github.com/Vanessa219/vditor/issues/383) 移动端移除侧边提示 `改进功能`
 * [384](https://github.com/Vanessa219/vditor/issues/384) ctrl_+, ctrl_- at heading(wysiwyg) `修复缺陷`
 * [384](https://github.com/Vanessa219/vditor/issues/384) ctrl_+, ctrl_- at heading(wysiwyg) `修复缺陷`
 * [321](https://github.com/Vanessa219/vditor/issues/321) 移动端如何调用toolbar的方法 `咨询提问`
 * [321](https://github.com/Vanessa219/vditor/issues/321) 移动端如何调用toolbar的方法 `咨询提问`
 * [382](https://github.com/Vanessa219/vditor/issues/382) sometimes the keyboard is hidden at smartphone `修复缺陷`
 * [382](https://github.com/Vanessa219/vditor/issues/382) sometimes the keyboard is hidden at smartphone `修复缺陷`

+ 16 - 0
src/assets/scss/_ir.scss

@@ -243,3 +243,19 @@
     }
     }
   }
   }
 }
 }
+
+@media screen and (max-width: $max-width) {
+  .vditor-ir {
+    h1:before,
+    h2:before,
+    h3:before,
+    h4:before,
+    h5:before,
+    h6:before,
+    div[data-type="link-ref-defs-block"]:before,
+    div[data-type="footnotes-block"]:before,
+    .vditor-toc:before {
+      content: none;
+    }
+  }
+}

+ 17 - 0
src/assets/scss/_wysiwyg.scss

@@ -166,3 +166,20 @@
     color: var(--blockquote-color);
     color: var(--blockquote-color);
   }
   }
 }
 }
+
+@media screen and (max-width: $max-width) {
+  .vditor-wysiwyg {
+    h1:before,
+    h2:before,
+    h3:before,
+    h4:before,
+    h5:before,
+    h6:before,
+    div.vditor-wysiwyg__block:before,
+    div[data-type="link-ref-defs-block"]:before,
+    div[data-type="footnotes-block"]:before,
+    .vditor-toc:before {
+      content: none;
+    }
+  }
+}

+ 3 - 2
src/ts/ui/initUI.ts

@@ -110,16 +110,17 @@ export const initUI = (vditor: IVditor) => {
 };
 };
 
 
 export const setPadding = (vditor: IVditor) => {
 export const setPadding = (vditor: IVditor) => {
+    const minPadding = window.innerWidth <= 520 ? 10 : 35;
     if (vditor.wysiwyg.element.parentElement.style.display !== "none") {
     if (vditor.wysiwyg.element.parentElement.style.display !== "none") {
         const padding = (vditor.wysiwyg.element.parentElement.clientWidth
         const padding = (vditor.wysiwyg.element.parentElement.clientWidth
             - vditor.options.preview.maxWidth) / 2;
             - vditor.options.preview.maxWidth) / 2;
-        vditor.wysiwyg.element.style.padding = `10px ${Math.max(35, padding)}px`;
+        vditor.wysiwyg.element.style.padding = `10px ${Math.max(minPadding, padding)}px`;
     }
     }
 
 
     if (vditor.ir.element.parentElement.style.display !== "none") {
     if (vditor.ir.element.parentElement.style.display !== "none") {
         const padding = (vditor.ir.element.parentElement.clientWidth
         const padding = (vditor.ir.element.parentElement.clientWidth
             - vditor.options.preview.maxWidth) / 2;
             - vditor.options.preview.maxWidth) / 2;
-        vditor.ir.element.style.padding = `10px ${Math.max(35, padding)}px`;
+        vditor.ir.element.style.padding = `10px ${Math.max(minPadding, padding)}px`;
     }
     }
 
 
     let outlineWidth = 0;
     let outlineWidth = 0;