File tree Expand file tree Collapse file tree 5 files changed +35
-5
lines changed Expand file tree Collapse file tree 5 files changed +35
-5
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,11 @@ export default function actions(action, value) {
161161 return true ;
162162
163163 case "set-height" :
164- setHeight ( value ) ;
164+ if ( typeof value === "object" ) {
165+ setHeight ( value . height , value . save ) ;
166+ } else {
167+ setHeight ( value ) ;
168+ }
165169 return true ;
166170
167171 case "search-prev" :
@@ -275,12 +279,14 @@ function toggle() {
275279 focusEditor ( ) ;
276280}
277281
278- function setHeight ( height = 1 ) {
282+ function setHeight ( height = 1 , save = true ) {
279283 const { $footer, $row1, $row2 } = quickTools ;
280284 const { editor } = editorManager ;
281285
282286 setFooterHeight ( height ) ;
283- appSettings . update ( { quickTools : height } , false ) ;
287+ if ( save ) {
288+ appSettings . update ( { quickTools : height } , false ) ;
289+ }
284290 editor . resize ( true ) ;
285291
286292 if ( ! height ) {
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ export default class EditorFile {
4949 * @type {HTMLElement }
5050 */
5151 #content = null ;
52+ /**
53+ * Whether to hide quicktools for this tab
54+ * @type {boolean }
55+ */
56+ hideQuickTools = false ;
5257
5358 /**
5459 * Custom stylesheets for tab
@@ -186,6 +191,8 @@ export default class EditorFile {
186191 const { addFile, getFile } = editorManager ;
187192 let doesExists = null ;
188193
194+ this . hideQuickTools = options ?. hideQuickTools || false ;
195+
189196 // if options are passed
190197 if ( options ) {
191198 // if options doesn't contains id, and provide a new id
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import ScrollBar from "components/scrollbar";
99import SideButton , { sideButtonContainer } from "components/sideButton" ;
1010import keyboardHandler from "handlers/keyboard" ;
1111import { keydownState } from "handlers/keyboard" ;
12+ import actions from "handlers/quickTools" ;
1213import sidebarApps from "sidebarApps" ;
1314import EditorFile from "./editorFile" ;
1415import appSettings from "./settings" ;
@@ -645,6 +646,14 @@ async function EditorManager($header, $body) {
645646
646647 manager . activeFile = file ;
647648
649+ if ( file . hideQuickTools ) {
650+ root . classList . add ( "hide-floating-button" ) ;
651+ actions ( "set-height" , { height : 0 , save : false } ) ;
652+ } else {
653+ root . classList . remove ( "hide-floating-button" ) ;
654+ actions ( "set-height" , appSettings . value . quickTools ) ;
655+ }
656+
648657 if ( file . type === "editor" ) {
649658 editor . setSession ( file . session ) ;
650659 editor . setReadOnly ( ! file . editable || ! ! file . loading ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ const THEME_IDENTIFIERS = new Set([
2121 "sweet" ,
2222 "moonlight" ,
2323 "bluloco" ,
24+ "acode.plugin.extra_syntax_highlights" ,
2425] ) ;
2526
2627export default async function loadPlugins ( loadOnlyTheme = false ) {
Original file line number Diff line number Diff line change @@ -510,8 +510,15 @@ async function loadApp() {
510510 function onEditorUpdate ( mode , saveState = true ) {
511511 const { activeFile } = editorManager ;
512512
513- if ( ! $editMenuToggler . isConnected ) {
514- $header . insertBefore ( $editMenuToggler , $header . lastChild ) ;
513+ // if (!$editMenuToggler.isConnected) {
514+ // $header.insertBefore($editMenuToggler, $header.lastChild);
515+ // }
516+ if ( activeFile ?. type === "page" ) {
517+ $editMenuToggler . remove ( ) ;
518+ } else {
519+ if ( ! $editMenuToggler . isConnected ) {
520+ $header . insertBefore ( $editMenuToggler , $header . lastChild ) ;
521+ }
515522 }
516523
517524 if ( mode === "switch-file" ) {
You can’t perform that action at this time.
0 commit comments