File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import SponsorDialog from '../sponsor/SponsorDialog';
1616import StatusBar from '../status-bar/StatusBar' ;
1717import Toolbar from '../toolbar/Toolbar' ;
1818import Tour from '../tour/Tour' ;
19- import { isMacOS } from '../utils/os' ;
2019import { docsDefaultPage } from './constants' ;
2120import { useI18n } from './i18n' ;
2221
@@ -47,8 +46,6 @@ const Terminal = React.lazy(async () => {
4746} ) ;
4847
4948const Docs : React . FunctionComponent = ( ) => {
50- const { setIsSettingShowDocsEnabled } = useSettingIsShowDocsEnabled ( ) ;
51-
5249 return (
5350 < iframe
5451 onLoad = { ( e ) => {
@@ -59,23 +56,6 @@ const Docs: React.FunctionComponent = () => {
5956 return ;
6057 }
6158
62- // Override browser default key bindings in iframe.
63- contentWindow . document . addEventListener ( 'keydown' , ( e ) => {
64- // use Ctrl-D/Cmd-D to toggle docs
65- if (
66- ( isMacOS ( )
67- ? e . metaKey && ! e . ctrlKey
68- : e . ctrlKey && ! e . metaKey ) &&
69- ! e . altKey &&
70- e . key === 'd'
71- ) {
72- e . preventDefault ( ) ;
73- // since the iframe is only visible when docs are shown
74- // the only action is to hide the docs
75- setIsSettingShowDocsEnabled ( false ) ;
76- }
77- } ) ;
78-
7959 if ( document . body . classList . contains ( Classes . DARK ) ) {
8060 contentWindow . document . documentElement . classList . add ( Classes . DARK ) ;
8161 }
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: MIT
2- // Copyright (c) 2020-2023 The Pybricks Authors
2+ // Copyright (c) 2020-2026 The Pybricks Authors
33
44import './editor.scss' ;
55import {
@@ -409,17 +409,6 @@ const Editor: React.FunctionComponent = () => {
409409 [ i18n ] ,
410410 ) ;
411411
412- useEditorAction (
413- editor ,
414- ( ) => ( {
415- id : 'pybricks.action.toggleDocs' ,
416- label : i18n . translate ( 'toggleDocs' ) ,
417- run : ( ) => toggleIsSettingShowDocsEnabled ( ) ,
418- keybindings : [ monaco . KeyMod . CtrlCmd | monaco . KeyCode . KeyD ] ,
419- } ) ,
420- [ i18n , toggleIsSettingShowDocsEnabled ] ,
421- ) ;
422-
423412 useEditorAction (
424413 editor ,
425414 ( ) => ( {
You can’t perform that action at this time.
0 commit comments