 
   componentWillMount: ->
     @updateViewPlanStatesByParams()
+
+  componentWillUpdate: (nextProps, nextState) ->
+    {planId} = @context.router.getCurrentParams()
+
+    if (planId is @props.item.plan.id) and not nextState.isViewingStats
+      nextState.triggerPlanStats = true
+    else if not planId? and @state.isViewingStats
+      # close modal if there is not a planId in the route and modal is open
+      nextState.triggerPlanStats = false
+      nextState.isViewingStats = false
+      @refs.trigger.hide(true)
 
   componentDidMount: ->
     @closePlanOnModalHide()

      hide = @refs.trigger.hide
      trigger = React.findDOMNode(@refs.trigger)
      syncClosePlan = @syncClosePlan

      # alias modal hide to also make plan look un-selected
      @refs.trigger.hide  = ->
        hide()
        syncClosePlan(trigger)

  syncOpenPlan: (mouseEvent, key) ->
    samePlans = @findPlanNodes(mouseEvent.currentTarget)


  getInitialState: ->
    triggerPlanStats: false
    isViewingStats: false

  showPlanStats: ->
    if @state.triggerPlanStats and not @state.isViewingStats and @refs.trigger?
      triggerEl = @refs.trigger.getDOMNode()
      triggerEl.click()

