Browse Source

:sparkles: add menu click

Van 5 years ago
parent
commit
e90fb50bd7
2 changed files with 5 additions and 1 deletions
  1. 4 0
      src/ts/toolbar/Fullscreen.ts
  2. 1 1
      src/ts/types/index.d.ts

+ 4 - 0
src/ts/toolbar/Fullscreen.ts

@@ -37,6 +37,10 @@ export class Fullscreen extends MenuItem {
             if (vditor.devtools && vditor.devtools.ASTChart && vditor.devtools.element.style.display === "block") {
                 vditor.devtools.ASTChart.resize();
             }
+
+            if (menuItem.click) {
+                menuItem.click(vditorElement.classList.contains("vditor--fullscreen"));
+            }
         });
     }
 }

+ 1 - 1
src/ts/types/index.d.ts

@@ -136,7 +136,7 @@ interface IMenuItem {
     prefix?: string;
     tipPosition?: string;
 
-    click?(): void;
+    click?(status?: boolean): void;
 }
 
 interface IPreviewMode {