File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/jupyter_contrib_nbextensions/nbextensions/code_prettify Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -182,21 +182,31 @@ define([
182
182
} ) ;
183
183
} ;
184
184
185
+
185
186
KernelExecOnCells . prototype . add_toolbar_button = function ( ) {
186
187
if ( $ ( '#' + this . mod_name + '_button' ) . length < 1 ) {
187
188
var button_group_id = this . mod_name + '_button' ;
188
189
var that = this ;
189
190
Jupyter . toolbar . add_buttons_group ( [ {
190
- label : this . cfg . kbd_shortcut_text + ' selected cell(s) (add shift for all cells)' ,
191
+ label : ' ' , //space otherwise add_buttons fails -- This label is inserted as a button description AND bubble help
191
192
icon : this . cfg . button_icon ,
192
193
callback : function ( evt ) {
193
194
that . autoformat_cells (
194
195
evt . shiftKey ? Jupyter . notebook . get_cells ( ) . map ( function ( cell , idx ) { return idx ; } ) : undefined
195
196
) ;
196
197
} ,
197
198
} ] , button_group_id ) ;
199
+
200
+ // Correct add_buttons_group default
201
+ // Change title --> inserts bubble help
202
+ // redefine icon to remove spurious space
203
+ var w = $ ( '#' + button_group_id + ' > .btn' ) [ 0 ] ;
204
+ w . title = this . cfg . kbd_shortcut_text + ' selected cell(s) (add shift for all cells)'
205
+ w . innerHTML = '<i class="' + this . cfg . button_icon + ' fa"></i>'
198
206
}
199
- } ;
207
+ }
208
+
209
+
200
210
201
211
KernelExecOnCells . prototype . add_keyboard_shortcuts = function ( ) {
202
212
var new_shortcuts = { } ;
You can’t perform that action at this time.
0 commit comments