@@ -22,7 +22,7 @@ mpl.figure = function (figure_id, websocket, ondownload, parent_element) {
22
22
23
23
this . ws = websocket ;
24
24
25
- this . supports_binary = this . ws . binaryType != undefined ;
25
+ this . supports_binary = this . ws . binaryType !== undefined ;
26
26
27
27
if ( ! this . supports_binary ) {
28
28
var warnings = document . getElementById ( 'mpl-warnings' ) ;
@@ -62,14 +62,14 @@ mpl.figure = function (figure_id, websocket, ondownload, parent_element) {
62
62
this . ws . onopen = function ( ) {
63
63
fig . send_message ( 'supports_binary' , { value : fig . supports_binary } ) ;
64
64
fig . send_message ( 'send_image_mode' , { } ) ;
65
- if ( mpl . ratio != 1 ) {
65
+ if ( mpl . ratio !== 1 ) {
66
66
fig . send_message ( 'set_dpi_ratio' , { dpi_ratio : mpl . ratio } ) ;
67
67
}
68
68
fig . send_message ( 'refresh' , { } ) ;
69
69
} ;
70
70
71
71
this . imageObj . onload = function ( ) {
72
- if ( fig . image_mode == 'full' ) {
72
+ if ( fig . image_mode === 'full' ) {
73
73
// Full images could contain transparency (where diff images
74
74
// almost always do), so we need to clear the canvas so that
75
75
// there is no ghosting.
@@ -336,7 +336,7 @@ mpl.figure.prototype.handle_save = function (fig, _msg) {
336
336
337
337
mpl . figure . prototype . handle_resize = function ( fig , msg ) {
338
338
var size = msg [ 'size' ] ;
339
- if ( size [ 0 ] != fig . canvas . width || size [ 1 ] != fig . canvas . height ) {
339
+ if ( size [ 0 ] !== fig . canvas . width || size [ 1 ] != = fig . canvas . height ) {
340
340
fig . _resize_canvas ( size [ 0 ] , size [ 1 ] ) ;
341
341
fig . send_message ( 'refresh' , { } ) ;
342
342
}
@@ -434,7 +434,7 @@ mpl.figure.prototype._make_on_message_function = function (fig) {
434
434
return ;
435
435
} else if (
436
436
typeof evt . data === 'string' &&
437
- evt . data . slice ( 0 , 21 ) == 'data:image/png;base64'
437
+ evt . data . slice ( 0 , 21 ) === 'data:image/png;base64'
438
438
) {
439
439
fig . imageObj . src = evt . data ;
440
440
fig . updated_canvas_event ( ) ;
@@ -485,7 +485,7 @@ mpl.findpos = function (e) {
485
485
} else if ( e . srcElement ) {
486
486
targ = e . srcElement ;
487
487
}
488
- if ( targ . nodeType == 3 ) {
488
+ if ( targ . nodeType === 3 ) {
489
489
// defeat Safari bug
490
490
targ = targ . parentNode ;
491
491
}
@@ -546,25 +546,25 @@ mpl.figure.prototype._key_event_extra = function (_event, _name) {
546
546
547
547
mpl . figure . prototype . key_event = function ( event , name ) {
548
548
// Prevent repeat events
549
- if ( name == 'key_press' ) {
549
+ if ( name === 'key_press' ) {
550
550
if ( event . which === this . _key ) {
551
551
return ;
552
552
} else {
553
553
this . _key = event . which ;
554
554
}
555
555
}
556
- if ( name == 'key_release' ) {
556
+ if ( name === 'key_release' ) {
557
557
this . _key = null ;
558
558
}
559
559
560
560
var value = '' ;
561
- if ( event . ctrlKey && event . which != 17 ) {
561
+ if ( event . ctrlKey && event . which !== 17 ) {
562
562
value += 'ctrl+' ;
563
563
}
564
- if ( event . altKey && event . which != 18 ) {
564
+ if ( event . altKey && event . which !== 18 ) {
565
565
value += 'alt+' ;
566
566
}
567
- if ( event . shiftKey && event . which != 16 ) {
567
+ if ( event . shiftKey && event . which !== 16 ) {
568
568
value += 'shift+' ;
569
569
}
570
570
@@ -578,7 +578,7 @@ mpl.figure.prototype.key_event = function (event, name) {
578
578
} ;
579
579
580
580
mpl . figure . prototype . toolbar_button_onclick = function ( name ) {
581
- if ( name == 'download' ) {
581
+ if ( name === 'download' ) {
582
582
this . handle_save ( this , null ) ;
583
583
} else {
584
584
this . send_message ( 'toolbar_button' , { name : name } ) ;
0 commit comments