File tree Expand file tree Collapse file tree 3 files changed +18
-11
lines changed
store/modules/preferences Expand file tree Collapse file tree 3 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -16,18 +16,19 @@ import Editor from './Editor';
1616
1717class SandboxPage extends React . Component {
1818 componentWillMount ( ) {
19- if (
20- window . screen . availWidth < 800 &&
21- ! document . location . search . includes ( 'from-embed' )
22- ) {
23- const addedSign = document . location . search ? '&' : '?' ;
24- document . location . href =
25- document . location . href . replace ( '/s/' , '/embed/' ) +
26- addedSign +
27- 'codemirror=1' ;
28- } else {
29- this . fetchSandbox ( ) ;
19+ if ( window . screen . availWidth < 800 ) {
20+ if ( ! document . location . search . includes ( 'from-embed' ) ) {
21+ const addedSign = document . location . search ? '&' : '?' ;
22+ document . location . href =
23+ document . location . href . replace ( '/s/' , '/embed/' ) +
24+ addedSign +
25+ 'codemirror=1' ;
26+ } else {
27+ this . props . signals . preferences . codeMirrorForced ( ) ;
28+ }
3029 }
30+
31+ this . fetchSandbox ( ) ;
3132 }
3233
3334 fetchSandbox = ( ) => {
Original file line number Diff line number Diff line change @@ -62,5 +62,6 @@ export default Module({
6262 paymentDetailsUpdated : sequences . updatePaymentDetails ,
6363 keybindingChanged : sequences . changeKeybinding ,
6464 zenModeToggled : sequences . toggleZenMode ,
65+ codeMirrorForced : sequences . forceCodeMirror ,
6566 } ,
6667} ) ;
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ export const changeViewMode = [
1717
1818export const toggleZenMode = toggle ( state `preferences.settings.zenMode` ) ;
1919
20+ export const forceCodeMirror = set (
21+ state `preferences.settings.codeMirror` ,
22+ true
23+ ) ;
24+
2025export const setDevtoolsOpen = set (
2126 state `preferences.showDevtools` ,
2227 props `open`
You can’t perform that action at this time.
0 commit comments