File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -279,15 +279,14 @@ cls.ResourceInspector = function(network_logger)
279279
280280 // scroll into view
281281 var container = this . tree_view . get_container ( ) . firstChild ;
282- var e_top = e . offsetTop ;
283- var e_bottom = e_top + e . offsetHeight ;
284- var container_top = container . scrollTop ;
285- var container_height = container . offsetHeight ;
286-
287- if ( e_top < container_top )
288- container . scrollTop = e_top ;
289- else if ( e_bottom > container_top + container_height )
290- container . scrollTop = e_bottom - container_height ;
282+ var y = container . scrollTop ;
283+ var max_y = e . offsetTop ;
284+ var min_y = max_y + e . offsetHeight - container . offsetHeight ;
285+
286+ if ( y < min_y )
287+ container . scrollTop = min_y ;
288+ else if ( y > max_y )
289+ container . scrollTop = max_y ;
291290 }
292291 } . bind ( this ) ;
293292
You can’t perform that action at this time.
0 commit comments