mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	improved logic to set inital active pane
This commit is contained in:
		
							parent
							
								
									0032069c27
								
							
						
					
					
						commit
						f472bf8585
					
				| @ -6,19 +6,19 @@ var TabView = React.createClass({ | ||||
|     }, | ||||
| 
 | ||||
|     getInitialState: function() { | ||||
|         return {activeTab: this.props.tabPanes[0]}; | ||||
|     }, | ||||
|         var activeTab = this.props.tabPanes[0]; | ||||
| 
 | ||||
|     componentDidMount:function() { | ||||
|         var userHash = window.location.hash; | ||||
|         if(userHash) { | ||||
|             userHash = userHash.split("#")[1]; | ||||
|             this.props.tabPanes.forEach(function(pane) { | ||||
|                if(pane.name === userHash) { | ||||
|                    this.setState({activeTab: pane}) | ||||
|                } | ||||
|                 if(pane.name === userHash) { | ||||
|                     activeTab = pane; | ||||
|                 } | ||||
|             }.bind(this)); | ||||
|         } | ||||
| 
 | ||||
|         return {activeTab: activeTab}; | ||||
|     }, | ||||
| 
 | ||||
|     handleChangeTab: function(tabPane) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user