@@ -159,6 +159,40 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, zo
159159 curEnd = minLaunchTime + zoomMax ;
160160 }
161161 taskTimeline . setWindow ( minLaunchTime , curEnd ) ;
162+ taskTimeline . on ( "rangechange" , function ( prop ) {
163+ if ( currentDisplayedTooltip !== null ) {
164+ $ ( currentDisplayedTooltip ) . tooltip ( "hide" ) ;
165+ }
166+ } ) ;
167+
168+ function getTaskIdxAndAttempt ( selector ) {
169+ var taskIdxText = $ ( selector ) . attr ( "data-title" ) ;
170+ var taskIdxAndAttempt = taskIdxText . match ( "Task (\\d+) \\(attempt (\\d+)" ) ;
171+ var taskIdx = taskIdxAndAttempt [ 1 ] ;
172+ var taskAttempt = taskIdxAndAttempt [ 2 ] ;
173+ return taskIdx + "-" + taskAttempt ;
174+ }
175+
176+ // If we zoom up and a box moves away when the corresponding tooltip is shown,
177+ // the tooltip can be remain.
178+ // So, we need to hide tooltips using another mechanism.
179+ var currentDisplayedTooltip = null ;
180+
181+ $ ( "#task-assignment-timeline" ) . on ( {
182+ "mouseenter" : function ( ) {
183+ var taskIdxAndAttempt = getTaskIdxAndAttempt ( this ) ;
184+ $ ( "#task-" + taskIdxAndAttempt ) . addClass ( "corresponding-item-hover" ) ;
185+ $ ( this ) . tooltip ( "show" ) ;
186+ currentDisplayedTooltip = this ;
187+ } ,
188+ "mouseleave" : function ( ) {
189+ var taskIdxAndAttempt = getTaskIdxAndAttempt ( this ) ;
190+ $ ( "#task-" + taskIdxAndAttempt ) . removeClass ( "corresponding-item-hover" ) ;
191+ $ ( this ) . tooltip ( "hide" ) ;
192+ currentDisplayedTooltip = null ;
193+ }
194+ } , ".task-assignment-timeline-content" ) ;
195+
162196 setupZoomable ( '#task-assignment-timeline-zoom-lock' , taskTimeline ) ;
163197
164198 $ ( "span.expand-task-assignment-timeline" ) . click ( function ( ) {
@@ -170,16 +204,6 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, zo
170204 } ) ;
171205}
172206
173- function setupTaskEventActionOnMouseOver ( taskIdAndAttempt ) {
174- $ ( "#task-" + taskIdAndAttempt ) . addClass ( "corresponding-item-hover" ) ;
175- $ ( "#task-event-" + taskIdAndAttempt ) . tooltip ( "show" ) ;
176- }
177-
178- function setupTaskEventActionOnMouseOut ( taskIdAndAttempt ) {
179- $ ( "#task-" + taskIdAndAttempt ) . removeClass ( "corresponding-item-hover" ) ;
180- $ ( "#task-" + taskIdAndAttempt ) . tooltip ( "hide" ) ;
181- }
182-
183207function setupExecutorEventAction ( ) {
184208 $ ( ".item.box.executor" ) . each ( function ( ) {
185209 $ ( this ) . hover (
0 commit comments