web: in registerCharClick set the window.location.hash and listen to that event to highlight the new row
This commit is contained in:
		
							parent
							
								
									b6c3ba1caf
								
							
						
					
					
						commit
						71f4dc53b1
					
				| @ -31,6 +31,10 @@ $(document).ready(function() { | ||||
|   if (window.location.hash && $(window.location.hash)[0]) { | ||||
|     $(window.location.hash).addClass('highlighted'); | ||||
|   } | ||||
|   $(window).on('hashchange', function(event) { | ||||
|     $('.highlighted').removeClass('highlighted'); | ||||
|     $(window.location.hash).addClass('highlighted'); | ||||
|   }); | ||||
| }); | ||||
| 
 | ||||
| //----------------------------------------------------------------------
 | ||||
| @ -99,8 +103,10 @@ function registerChart($container, series) { | ||||
| 
 | ||||
| function registerChartClick(ev, pos, item) { | ||||
|   if (item) { | ||||
|     $target = $('#'+item.series.data[item.dataIndex][5]); | ||||
|     targetselector = '#'+item.series.data[item.dataIndex][5]; | ||||
|     $target = $(targetselector); | ||||
|     if ($target.length) { | ||||
|       window.location.hash = targetselector; | ||||
|       $('html, body').animate({ | ||||
|         scrollTop: $target.offset().top | ||||
|       }, 1000); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user