reload charts on firefox when tabs are switched
This commit is contained in:
		@@ -1,3 +1,24 @@
 | 
			
		||||
// reload all charts on the page
 | 
			
		||||
function reloadCharts() {
 | 
			
		||||
  // exit if this is not firefox
 | 
			
		||||
  if (navigator.userAgent.toLowerCase().indexOf('firefox') === -1) { return false; }
 | 
			
		||||
 | 
			
		||||
  // for each iframe that is about to be activated
 | 
			
		||||
  $('.ui-widget-content [aria-expanded="false"]').find('iframe').each(function() {
 | 
			
		||||
    // get the src of the iframe
 | 
			
		||||
    var iframe_src = $(this).attr('src');
 | 
			
		||||
    // if this is a chart
 | 
			
		||||
    if (iframe_src.indexOf('charts') !== -1) {
 | 
			
		||||
      // hide the chart
 | 
			
		||||
      $(this).hide();
 | 
			
		||||
      // reload the src
 | 
			
		||||
      $(this).attr('src', iframe_src);
 | 
			
		||||
      // show the chart
 | 
			
		||||
      $(this).show();
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// update the chart with all the textbox values
 | 
			
		||||
function openDialogCenter(element) {
 | 
			
		||||
    element.dialog("open");
 | 
			
		||||
 
 | 
			
		||||
@@ -100,13 +100,14 @@ $(function () {
 | 
			
		||||
      else {
 | 
			
		||||
	  $("#watchText").text("Watch");
 | 
			
		||||
      }
 | 
			
		||||
      $("#maincontent").tabs( {
 | 
			
		||||
				  select: function( e, ui)
 | 
			
		||||
				  {
 | 
			
		||||
				      $.cookie('stickyTab', ui.index );
 | 
			
		||||
				  }
 | 
			
		||||
			      }
 | 
			
		||||
			    );
 | 
			
		||||
      $("#maincontent").tabs({
 | 
			
		||||
			  select: function( e, ui) {
 | 
			
		||||
				  $.cookie('stickyTab', ui.index );
 | 
			
		||||
				},
 | 
			
		||||
				activate: function( event, ui ) {
 | 
			
		||||
				  reloadCharts();
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
      stickyTab = $.cookie( 'stickyTab' );
 | 
			
		||||
      anchor = window.location.hash;
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								public/assets/application-5723d6b7daa178c1fc7743adfaa30049.js.gz
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								public/assets/application-5723d6b7daa178c1fc7743adfaa30049.js.gz
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user