mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Start API calls before the panel has finished loading
This commit is contained in:
		| @@ -72,8 +72,11 @@ function activatePanel(panelName, options={}) { | ||||
|  | ||||
|     // Display the panel | ||||
|     $(panel).addClass('panel-visible'); | ||||
|  | ||||
|     // Load the data | ||||
|     $(panel).trigger('fadeInStarted'); | ||||
|  | ||||
|     $(panel).fadeIn(100, function() { | ||||
|         $(panel).trigger('fadeInComplete'); | ||||
|     }); | ||||
|  | ||||
|     // Un-select all selectors | ||||
| @@ -86,7 +89,6 @@ function activatePanel(panelName, options={}) { | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| function onPanelLoad(panel, callback) { | ||||
|     // One-time callback when a panel is first displayed | ||||
|     // Used to implement lazy-loading, rather than firing  | ||||
| @@ -94,13 +96,13 @@ function onPanelLoad(panel, callback) { | ||||
|  | ||||
|     var panelId = `#panel-${panel}`; | ||||
|  | ||||
|     $(panelId).on('fadeInComplete', function(e) { | ||||
|     $(panelId).on('fadeInStarted', function(e) { | ||||
|  | ||||
|         // Trigger the callback | ||||
|         callback(); | ||||
|  | ||||
|         // Turn off the event | ||||
|         $(panelId).off('fadeInComplete'); | ||||
|         $(panelId).off('fadeInStarted'); | ||||
|  | ||||
|     }); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user