@@ -339,17 +339,21 @@ var MPLCanvasView = widgets.DOMWidgetView.extend({
339
339
} ,
340
340
341
341
_init_canvas : function ( ) {
342
+ var canvas_container = document . createElement ( 'div' ) ;
343
+ canvas_container . classList = 'jupyter-widgets jupyter-matplotlib-canvas-container' ;
344
+ this . figure . appendChild ( canvas_container ) ;
345
+
342
346
var canvas_div = this . canvas_div = document . createElement ( 'div' ) ;
343
347
canvas_div . style . position = 'relative' ;
344
348
canvas_div . style . clear = 'both' ;
345
- canvas_div . classList = 'jupyter-widgets jupyter-matplotlib-canvas_div ' ;
349
+ canvas_div . classList = 'jupyter-widgets jupyter-matplotlib-canvas-div ' ;
346
350
347
351
canvas_div . addEventListener ( 'keydown' , this . key_event ( 'key_press' ) ) ;
348
352
canvas_div . addEventListener ( 'keyup' , this . key_event ( 'key_release' ) ) ;
349
353
350
354
// this is important to make the div 'focusable'
351
355
canvas_div . setAttribute ( 'tabindex' , 0 ) ;
352
- this . figure . appendChild ( canvas_div ) ;
356
+ canvas_container . appendChild ( canvas_div ) ;
353
357
354
358
var canvas = this . canvas = document . createElement ( 'canvas' ) ;
355
359
canvas . style . display = 'block' ;
@@ -520,12 +524,6 @@ var MPLCanvasView = widgets.DOMWidgetView.extend({
520
524
step : event . step ,
521
525
guiEvent : utils . get_simple_keys ( event ) } ) ;
522
526
}
523
-
524
- /* This prevents the web browser from automatically changing to
525
- * the text insertion cursor when the button is pressed. We want
526
- * to control all of the cursor setting manually through the
527
- * 'cursor' event from matplotlib */
528
- event . preventDefault ( ) ;
529
527
} ;
530
528
} ,
531
529
0 commit comments