@@ -2,6 +2,8 @@ var widgets = require('@jupyter-widgets/base');
2
2
var _ = require ( 'underscore' ) ;
3
3
var L = require ( '../leaflet.js' ) ;
4
4
var layer = require ( './Layer.js' ) ;
5
+ var PMessaging = require ( '@phosphor/messaging' ) ;
6
+ var PWidgets = require ( '@phosphor/widgets' ) ;
5
7
var LeafletUILayerView = layer . LeafletUILayerView ;
6
8
var LeafletUILayerModel = layer . LeafletUILayerModel ;
7
9
var def_loc = [ 0.0 , 0.0 ] ;
@@ -57,14 +59,10 @@ var LeafletPopupView = LeafletUILayerView.extend({
57
59
var that = this ;
58
60
this . child_promise = this . child_promise . then ( function ( ) {
59
61
return that . create_child_view ( value ) . then ( function ( view ) {
60
- that . obj . setContent ( view . el ) ;
62
+ PMessaging . MessageLoop . sendMessage ( view . pWidget , PWidgets . Widget . Msg . BeforeAttach ) ;
63
+ thar . obj . setContent ( view . el ) ;
64
+ PMessaging . MessageLoop . sendMessage ( view . pWidget , PWidgets . Widget . Msg . AfterAttach ) ;
61
65
that . force_update ( ) ;
62
-
63
- // Trigger the displayed event of the child view.
64
- that . displayed . then ( function ( ) {
65
- view . trigger ( 'displayed' , that ) ;
66
- } ) ;
67
-
68
66
that . child = view ;
69
67
that . trigger ( 'child:created' ) ;
70
68
} ) ;
@@ -99,8 +97,7 @@ var LeafletPopupView = LeafletUILayerView.extend({
99
97
if ( this . map_view . obj . hasLayer ( this . obj ) ) {
100
98
this . map_view . obj . closePopup ( this . obj ) ;
101
99
this . map_view . obj . openPopup ( this . obj ) ;
102
- }
103
- else {
100
+ } else {
104
101
this . map_view . obj . openPopup ( this . obj ) ;
105
102
this . map_view . obj . closePopup ( this . obj ) ;
106
103
}
0 commit comments