@@ -22,7 +22,7 @@ mpl.figure = function (figure_id, websocket, ondownload, parent_element) {
2222
2323 this . ws = websocket ;
2424
25- this . supports_binary = this . ws . binaryType != undefined ;
25+ this . supports_binary = this . ws . binaryType !== undefined ;
2626
2727 if ( ! this . supports_binary ) {
2828 var warnings = document . getElementById ( 'mpl-warnings' ) ;
@@ -62,14 +62,14 @@ mpl.figure = function (figure_id, websocket, ondownload, parent_element) {
6262 this . ws . onopen = function ( ) {
6363 fig . send_message ( 'supports_binary' , { value : fig . supports_binary } ) ;
6464 fig . send_message ( 'send_image_mode' , { } ) ;
65- if ( mpl . ratio != 1 ) {
65+ if ( mpl . ratio !== 1 ) {
6666 fig . send_message ( 'set_dpi_ratio' , { dpi_ratio : mpl . ratio } ) ;
6767 }
6868 fig . send_message ( 'refresh' , { } ) ;
6969 } ;
7070
7171 this . imageObj . onload = function ( ) {
72- if ( fig . image_mode == 'full' ) {
72+ if ( fig . image_mode === 'full' ) {
7373 // Full images could contain transparency (where diff images
7474 // almost always do), so we need to clear the canvas so that
7575 // there is no ghosting.
@@ -336,7 +336,7 @@ mpl.figure.prototype.handle_save = function (fig, _msg) {
336336
337337mpl . figure . prototype . handle_resize = function ( fig , msg ) {
338338 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 ) {
340340 fig . _resize_canvas ( size [ 0 ] , size [ 1 ] ) ;
341341 fig . send_message ( 'refresh' , { } ) ;
342342 }
@@ -434,7 +434,7 @@ mpl.figure.prototype._make_on_message_function = function (fig) {
434434 return ;
435435 } else if (
436436 typeof evt . data === 'string' &&
437- evt . data . slice ( 0 , 21 ) == 'data:image/png;base64'
437+ evt . data . slice ( 0 , 21 ) === 'data:image/png;base64'
438438 ) {
439439 fig . imageObj . src = evt . data ;
440440 fig . updated_canvas_event ( ) ;
@@ -485,7 +485,7 @@ mpl.findpos = function (e) {
485485 } else if ( e . srcElement ) {
486486 targ = e . srcElement ;
487487 }
488- if ( targ . nodeType == 3 ) {
488+ if ( targ . nodeType === 3 ) {
489489 // defeat Safari bug
490490 targ = targ . parentNode ;
491491 }
@@ -546,25 +546,25 @@ mpl.figure.prototype._key_event_extra = function (_event, _name) {
546546
547547mpl . figure . prototype . key_event = function ( event , name ) {
548548 // Prevent repeat events
549- if ( name == 'key_press' ) {
549+ if ( name === 'key_press' ) {
550550 if ( event . which === this . _key ) {
551551 return ;
552552 } else {
553553 this . _key = event . which ;
554554 }
555555 }
556- if ( name == 'key_release' ) {
556+ if ( name === 'key_release' ) {
557557 this . _key = null ;
558558 }
559559
560560 var value = '' ;
561- if ( event . ctrlKey && event . which != 17 ) {
561+ if ( event . ctrlKey && event . which !== 17 ) {
562562 value += 'ctrl+' ;
563563 }
564- if ( event . altKey && event . which != 18 ) {
564+ if ( event . altKey && event . which !== 18 ) {
565565 value += 'alt+' ;
566566 }
567- if ( event . shiftKey && event . which != 16 ) {
567+ if ( event . shiftKey && event . which !== 16 ) {
568568 value += 'shift+' ;
569569 }
570570
@@ -578,7 +578,7 @@ mpl.figure.prototype.key_event = function (event, name) {
578578} ;
579579
580580mpl . figure . prototype . toolbar_button_onclick = function ( name ) {
581- if ( name == 'download' ) {
581+ if ( name === 'download' ) {
582582 this . handle_save ( this , null ) ;
583583 } else {
584584 this . send_message ( 'toolbar_button' , { name : name } ) ;
0 commit comments