@@ -26,8 +26,12 @@ const { Trace, TraceError, FBTrace } = require("firebug.sdk/lib/core/trace.js").
26
26
const { Content } = require ( "firebug.sdk/lib/core/content.js" ) ;
27
27
const { Locale } = require ( "firebug.sdk/lib/core/locale.js" ) ;
28
28
29
+ // FireQuery
30
+ const { FireQueryToolboxOverlay } = require ( "./firequery-toolbox-overlay.js" ) ;
31
+
29
32
// Constants
30
33
const XHTML_NS = "http://www.w3.org/1999/xhtml" ;
34
+ const ToolboxOverlayId = FireQueryToolboxOverlay . prototype . overlayId ;
31
35
32
36
/**
33
37
* This object implements a tooltip used in the MarkupView that
@@ -36,6 +40,7 @@ const XHTML_NS = "http://www.w3.org/1999/xhtml";
36
40
* of the iframe is implemented by markup-tooltip.html
37
41
*/
38
42
function DataTooltip ( options ) {
43
+ this . context = options . context ;
39
44
this . toolbox = options . toolbox ;
40
45
this . markup = options . markup ;
41
46
this . target = options . target ;
@@ -125,6 +130,18 @@ DataTooltip.prototype =
125
130
} ) ;
126
131
} ,
127
132
133
+ onNavigate : function ( grip ) {
134
+ let toolboxOverlay = this . context . getOverlay ( ToolboxOverlayId ) ;
135
+ return toolboxOverlay . front . getNode ( grip . actor ) . then ( response => {
136
+ var node = response . node ;
137
+ this . markup . showNode ( node ) . then ( ( ) => {
138
+ // Mark the node as selected and focused.
139
+ this . markup . markNodeAsSelected ( node ) ;
140
+ this . markup . maybeFocusNewSelection ( ) ;
141
+ } ) ;
142
+ } ) ;
143
+ } ,
144
+
128
145
// Tooltip Content Communication
129
146
130
147
onContentMessage : function ( event ) {
@@ -141,6 +158,9 @@ DataTooltip.prototype =
141
158
case "getPrototypeAndProperties" :
142
159
this . onGetPrototypeAndProperties ( data . args ) ;
143
160
break ;
161
+ case "navigate" :
162
+ this . onNavigate ( data . args ) ;
163
+ break ;
144
164
}
145
165
} ,
146
166
0 commit comments