@@ -376,9 +376,10 @@ define([
376
376
this . getPackageVersion ( ) . then ( function ( latestVersion ) {
377
377
if ( nowVersion === latestVersion ) {
378
378
// if it's already up to date
379
+ // hide version update icon
380
+ $ ( '#vp_versionUpdater' ) . hide ( ) ;
379
381
if ( background ) {
380
- // hide version update icon
381
- $ ( '#vp_versionUpdater' ) . hide ( ) ;
382
+ ;
382
383
} else {
383
384
let msg = com_util . formatString ( 'Visual Python is up to date. ({0})' , latestVersion ) ;
384
385
com_util . renderInfoModal ( msg ) ;
@@ -389,45 +390,42 @@ define([
389
390
let msg = com_util . formatString ( 'Visual Python updates are available.<br/>(Latest version: {0} / Your version: {1})' ,
390
391
latestVersion , nowVersion ) ;
391
392
// show version update icon
392
- $ ( '#vp_versionUpdater' ) . attr ( 'title' , msg ) ;
393
+ $ ( '#vp_versionUpdater' ) . attr ( 'title' , msg . replace ( '<br/>' , '' ) ) ;
393
394
$ ( '#vp_versionUpdater' ) . data ( 'version' , latestVersion ) ;
394
395
$ ( '#vp_versionUpdater' ) . show ( ) ;
395
- if ( background ) {
396
- ;
397
- } else {
398
- // render update modal (same as menu/MenuFrame.js:_bindEvent()-Click version updater)
399
- com_util . renderModal ( {
400
- title : 'Update version' ,
401
- message : msg ,
402
- buttons : [ 'Cancel' , 'Update' ] ,
403
- defaultButtonIdx : 0 ,
404
- buttonClass : [ 'cancel' , 'activated' ] ,
405
- finish : function ( clickedBtnIdx ) {
406
- switch ( clickedBtnIdx ) {
407
- case 0 :
408
- // cancel
409
- break ;
410
- case 1 :
411
- // update
412
- let info = [
413
- '## Visual Python Upgrade' ,
414
- 'NOTE: ' ,
415
- '- Refresh your web browser to start a new version.' ,
416
- '- Save VP Note before refreshing the page.'
417
- ] ;
418
- com_interface . insertCell ( 'markdown' , info . join ( '\n' ) ) ;
419
- com_interface . insertCell ( 'code' , '!pip install visualpython --upgrade' ) ;
420
- com_interface . insertCell ( 'code' , '!visualpy install' ) ;
396
+
397
+ // render update modal
398
+ com_util . renderModal ( {
399
+ title : 'Update version' ,
400
+ message : msg ,
401
+ buttons : [ 'Cancel' , 'Update' ] ,
402
+ defaultButtonIdx : 0 ,
403
+ buttonClass : [ 'cancel' , 'activated' ] ,
404
+ finish : function ( clickedBtnIdx ) {
405
+ switch ( clickedBtnIdx ) {
406
+ case 0 :
407
+ // cancel
408
+ break ;
409
+ case 1 :
410
+ // update
411
+ let info = [
412
+ '## Visual Python Upgrade' ,
413
+ 'NOTE: ' ,
414
+ '- Refresh your web browser to start a new version.' ,
415
+ '- Save VP Note before refreshing the page.'
416
+ ] ;
417
+ com_interface . insertCell ( 'markdown' , info . join ( '\n' ) ) ;
418
+ com_interface . insertCell ( 'code' , '!pip install visualpython --upgrade' ) ;
419
+ com_interface . insertCell ( 'code' , '!visualpy install' ) ;
421
420
422
- // update version_timestamp
423
- that . setData ( { 'version_timestamp' : new Date ( ) . getTime ( ) } , 'vpcfg' ) ;
424
- // hide updater
425
- $ ( '#vp_versionUpdater' ) . hide ( ) ;
426
- break ;
427
- }
421
+ // update version_timestamp
422
+ that . setData ( { 'version_timestamp' : new Date ( ) . getTime ( ) } , 'vpcfg' ) ;
423
+ // hide updater
424
+ $ ( '#vp_versionUpdater' ) . hide ( ) ;
425
+ break ;
428
426
}
429
- } )
430
- }
427
+ }
428
+ } ) ;
431
429
}
432
430
} ) . catch ( function ( err ) {
433
431
if ( background ) {
0 commit comments