File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ var renderCode = function(exampleName) {
1818
1919 function enableTab ( el ) {
2020 el . onkeydown = function ( e ) {
21- if ( e . keyCode === 9 ) {
22- // tab was pressed
21+ if ( e . keyCode === 32 && e . shiftKey ) {
22+ // shift + space pressed
2323 // get caret position/selection
2424 var val = this . value ,
2525 start = this . selectionStart ,
@@ -85,10 +85,13 @@ var renderCode = function(exampleName) {
8585 edit_space . appendChild ( edit_area ) ;
8686 enableTab ( edit_area ) ;
8787
88- //add buttons
88+ //add buttons and tab instructions
8989 let button_space = document . createElement ( 'ul' ) ;
9090 edit_space . appendChild ( button_space ) ;
9191
92+ let sketch_tab_instructions = button_space . appendChild ( document . createElement ( 'li' ) ) ;
93+ sketch_tab_instructions . innerHTML = 'Press shift + space to insert tab.' ;
94+
9295 let copy_button = document . createElement ( 'button' ) ;
9396 copy_button . value = 'copy' ;
9497 copy_button . innerHTML = 'copy' ;
@@ -134,6 +137,7 @@ var renderCode = function(exampleName) {
134137 let edit_li = button_space . appendChild ( document . createElement ( 'li' ) ) ;
135138 edit_li . appendChild ( edit_button ) ;
136139
140+
137141 function setMode ( sketch , m ) {
138142 if ( m === 'edit' ) {
139143 $ ( '.example_container' ) . each ( function ( ind , con ) {
You can’t perform that action at this time.
0 commit comments