@@ -194,7 +194,7 @@ define(function (require, exports, module) {
194194 $modeBtn ,
195195 $modeBtnGroup ,
196196 $previewBtn ,
197- $fullScreenBtn ;
197+ $designModeBtn ;
198198
199199 let customLivePreviewBannerShown = false ;
200200
@@ -866,7 +866,7 @@ define(function (require, exports, module) {
866866 livePreview : Strings . LIVE_DEV_STATUS_TIP_OUT_OF_SYNC ,
867867 clickToReload : Strings . LIVE_DEV_CLICK_TO_RELOAD_PAGE ,
868868 clickToToggleEdit : Strings . LIVE_PREVIEW_MODE_TOGGLE_EDIT ,
869- fullScreenLivePreview : Strings . LIVE_PREVIEW_FULL_SCREEN ,
869+ switchToDesignMode : Strings . CCB_SWITCH_TO_DESIGN_MODE ,
870870 livePreviewSettings : Strings . LIVE_DEV_SETTINGS ,
871871 livePreviewConfigureModes : Strings . LIVE_PREVIEW_CONFIGURE_MODES ,
872872 clickToPopout : Strings . LIVE_DEV_CLICK_POPOUT ,
@@ -899,7 +899,7 @@ define(function (require, exports, module) {
899899 $modeBtn = $panel . find ( "#livePreviewModeBtn" ) ;
900900 $modeBtnGroup = $panel . find ( "#lpModeBtnGroup" ) ;
901901 $previewBtn = $panel . find ( "#previewModeLivePreviewButton" ) ;
902- $fullScreenBtn = $panel . find ( "#fullScreenLivePreviewButton " ) ;
902+ $designModeBtn = $panel . find ( "#designModeToggleLivePreviewButton " ) ;
903903
904904 // Markdown theme toggle — persist user choice
905905 MarkdownSync . setThemeToggleHandler ( ( theme ) => {
@@ -982,25 +982,26 @@ define(function (require, exports, module) {
982982 Metrics . countEvent ( Metrics . EVENT_TYPE . LIVE_PREVIEW , "reloadBtn" , "click" ) ;
983983 } ) ;
984984
985- function _updateFullScreenButton ( ) {
986- const on = WorkspaceManager . isInLPFullScreen && WorkspaceManager . isInLPFullScreen ( ) ;
987- $fullScreenBtn . find ( "i" )
985+ // Mirrors the control bar's design mode toggle so the user can switch without leaving the preview.
986+ function _updateDesignModeButton ( ) {
987+ const on = WorkspaceManager . isInDesignMode && WorkspaceManager . isInDesignMode ( ) ;
988+ $designModeBtn . find ( "i" )
988989 . removeClass ( "fa-expand fa-compress" )
989990 . addClass ( on ? "fa-compress" : "fa-expand" ) ;
990- $fullScreenBtn . attr ( "title" ,
991- on ? Strings . LIVE_PREVIEW_EXIT_FULL_SCREEN : Strings . LIVE_PREVIEW_FULL_SCREEN ) ;
991+ $designModeBtn . attr ( "title" ,
992+ on ? Strings . CCB_SWITCH_TO_CODE_EDITOR : Strings . CCB_SWITCH_TO_DESIGN_MODE ) ;
993+ if ( $modeBtn ) {
994+ $modeBtn . toggle ( ! on && ! _isMdviewrActive ) ;
995+ }
992996 }
993- $fullScreenBtn . click ( ( ) => {
994- CommandManager . execute ( Commands . VIEW_TOGGLE_LP_FULL_SCREEN ) ;
995- Metrics . countEvent ( Metrics . EVENT_TYPE . LIVE_PREVIEW , "fullScreenBtn " , "click" ) ;
997+ $designModeBtn . click ( ( ) => {
998+ CommandManager . execute ( Commands . VIEW_TOGGLE_DESIGN_MODE ) ;
999+ Metrics . countEvent ( Metrics . EVENT_TYPE . LIVE_PREVIEW , "designModeBtn " , "click" ) ;
9961000 } ) ;
9971001 WorkspaceManager . off ( WorkspaceManager . EVENT_WORKSPACE_DESIGN_MODE_CHANGE + ".livePreview" ) ;
9981002 WorkspaceManager . on ( WorkspaceManager . EVENT_WORKSPACE_DESIGN_MODE_CHANGE + ".livePreview" ,
999- _updateLPControlsForMdviewer ) ;
1000- WorkspaceManager . off ( WorkspaceManager . EVENT_WORKSPACE_LP_FULL_SCREEN_CHANGE + ".livePreview" ) ;
1001- WorkspaceManager . on ( WorkspaceManager . EVENT_WORKSPACE_LP_FULL_SCREEN_CHANGE + ".livePreview" ,
1002- _updateFullScreenButton ) ;
1003- _updateFullScreenButton ( ) ;
1003+ _updateDesignModeButton ) ;
1004+ _updateDesignModeButton ( ) ;
10041005
10051006 // init the status overlay
10061007 _initOverlay ( ) ;
0 commit comments