@@ -385,7 +385,7 @@ export class Yasqe extends EditorFacade {
385385 /**
386386 * draw share link button (SECOND)
387387 */
388- if ( this . config . createShareableLink ) {
388+ if ( this . config . createShareableLink && this . config . showShareButton ) {
389389 const shareIcon = document . createElement ( "i" ) ;
390390 addClass ( shareIcon , "fas" ) ;
391391 addClass ( shareIcon , "fa-share-nodes" ) ;
@@ -723,26 +723,28 @@ export class Yasqe extends EditorFacade {
723723 /**
724724 * Draw fullscreen btn (SIXTH)
725725 */
726- this . fullscreenBtn = document . createElement ( "button" ) ;
727- addClass ( this . fullscreenBtn , "yasqe_fullscreenButton" ) ;
728- const fullscreenIcon = document . createElement ( "i" ) ;
729- addClass ( fullscreenIcon , "fas" ) ;
730- addClass ( fullscreenIcon , "fa-expand" ) ;
731- addClass ( fullscreenIcon , "fullscreenIcon" ) ;
732- fullscreenIcon . setAttribute ( "aria-hidden" , "true" ) ;
733- this . fullscreenBtn . appendChild ( fullscreenIcon ) ;
734- const fullscreenExitIcon = document . createElement ( "i" ) ;
735- addClass ( fullscreenExitIcon , "fas" ) ;
736- addClass ( fullscreenExitIcon , "fa-compress" ) ;
737- addClass ( fullscreenExitIcon , "fullscreenExitIcon" ) ;
738- fullscreenExitIcon . setAttribute ( "aria-hidden" , "true" ) ;
739- this . fullscreenBtn . appendChild ( fullscreenExitIcon ) ;
740- this . fullscreenBtn . onclick = ( ) => {
741- this . toggleFullscreen ( ) ;
742- } ;
743- this . fullscreenBtn . title = "Toggle fullscreen (F11)" ;
744- this . fullscreenBtn . setAttribute ( "aria-label" , "Toggle fullscreen" ) ;
745- buttons . appendChild ( this . fullscreenBtn ) ;
726+ if ( this . config . showFullscreenButton ) {
727+ this . fullscreenBtn = document . createElement ( "button" ) ;
728+ addClass ( this . fullscreenBtn , "yasqe_fullscreenButton" ) ;
729+ const fullscreenIcon = document . createElement ( "i" ) ;
730+ addClass ( fullscreenIcon , "fas" ) ;
731+ addClass ( fullscreenIcon , "fa-expand" ) ;
732+ addClass ( fullscreenIcon , "fullscreenIcon" ) ;
733+ fullscreenIcon . setAttribute ( "aria-hidden" , "true" ) ;
734+ this . fullscreenBtn . appendChild ( fullscreenIcon ) ;
735+ const fullscreenExitIcon = document . createElement ( "i" ) ;
736+ addClass ( fullscreenExitIcon , "fas" ) ;
737+ addClass ( fullscreenExitIcon , "fa-compress" ) ;
738+ addClass ( fullscreenExitIcon , "fullscreenExitIcon" ) ;
739+ fullscreenExitIcon . setAttribute ( "aria-hidden" , "true" ) ;
740+ this . fullscreenBtn . appendChild ( fullscreenExitIcon ) ;
741+ this . fullscreenBtn . onclick = ( ) => {
742+ this . toggleFullscreen ( ) ;
743+ } ;
744+ this . fullscreenBtn . title = "Toggle fullscreen (F11)" ;
745+ this . fullscreenBtn . setAttribute ( "aria-label" , "Toggle fullscreen" ) ;
746+ buttons . appendChild ( this . fullscreenBtn ) ;
747+ }
746748
747749 /**
748750 * Draw hamburger menu button and dropdown (for mobile)
@@ -765,7 +767,7 @@ export class Yasqe extends EditorFacade {
765767 buttons . appendChild ( this . hamburgerMenu ) ;
766768
767769 // Add menu items
768- if ( this . config . createShareableLink ) {
770+ if ( this . shareBtn ) {
769771 const shareItem = document . createElement ( "button" ) ;
770772 shareItem . className = "yasqe_hamburgerMenuItem" ;
771773 const shareIconMenu = document . createElement ( "i" ) ;
@@ -851,21 +853,23 @@ export class Yasqe extends EditorFacade {
851853 this . hamburgerMenu . appendChild ( mapItem ) ;
852854 }
853855
854- const fullscreenItem = document . createElement ( "button" ) ;
855- fullscreenItem . className = "yasqe_hamburgerMenuItem" ;
856- const fullscreenIconMenu = document . createElement ( "i" ) ;
857- addClass ( fullscreenIconMenu , "fas" ) ;
858- addClass ( fullscreenIconMenu , "fa-expand" ) ;
859- fullscreenIconMenu . setAttribute ( "aria-hidden" , "true" ) ;
860- fullscreenItem . appendChild ( fullscreenIconMenu ) ;
861- const fullscreenLabel = document . createElement ( "span" ) ;
862- fullscreenLabel . textContent = "Fullscreen" ;
863- fullscreenItem . appendChild ( fullscreenLabel ) ;
864- fullscreenItem . onclick = ( ) => {
865- this . closeHamburgerMenu ( ) ;
866- this . toggleFullscreen ( ) ;
867- } ;
868- this . hamburgerMenu . appendChild ( fullscreenItem ) ;
856+ if ( this . config . showFullscreenButton ) {
857+ const fullscreenItem = document . createElement ( "button" ) ;
858+ fullscreenItem . className = "yasqe_hamburgerMenuItem" ;
859+ const fullscreenIconMenu = document . createElement ( "i" ) ;
860+ addClass ( fullscreenIconMenu , "fas" ) ;
861+ addClass ( fullscreenIconMenu , "fa-expand" ) ;
862+ fullscreenIconMenu . setAttribute ( "aria-hidden" , "true" ) ;
863+ fullscreenItem . appendChild ( fullscreenIconMenu ) ;
864+ const fullscreenLabel = document . createElement ( "span" ) ;
865+ fullscreenLabel . textContent = "Fullscreen" ;
866+ fullscreenItem . appendChild ( fullscreenLabel ) ;
867+ fullscreenItem . onclick = ( ) => {
868+ this . closeHamburgerMenu ( ) ;
869+ this . toggleFullscreen ( ) ;
870+ } ;
871+ this . hamburgerMenu . appendChild ( fullscreenItem ) ;
872+ }
869873
870874 // Toggle hamburger menu
871875 this . hamburgerBtn . onclick = ( e ) => {
@@ -2522,6 +2526,14 @@ export interface Config extends Omit<EditorOptions, "extraKeys"> {
25222526 * Show the Run button in the editor. Yasgui sets this to false: it shows its own Run button in the query bar.
25232527 */
25242528 showQueryButton : boolean ;
2529+ /**
2530+ * Show the Share button (and its item in the mobile menu). Setting `createShareableLink` to null also hides it.
2531+ */
2532+ showShareButton : boolean ;
2533+ /**
2534+ * Show the Fullscreen button (and its item in the mobile menu). F11 still toggles fullscreen.
2535+ */
2536+ showFullscreenButton : boolean ;
25252537 requestConfig : RequestConfig < Yasqe > | ( ( yasqe : Yasqe ) => RequestConfig < Yasqe > ) ;
25262538 pluginButtons : ( ( ) => HTMLElement [ ] | HTMLElement ) | undefined ;
25272539 highlightSelectionMatches : boolean | { showToken ?: RegExp ; annotateScrollbar ?: boolean } ;
0 commit comments