 Bootstrap.ItemSelection = Ember.Mixin.create(Bootstrap.ItemValue, Bootstrap.WithRouter,
     classNameBindings: ["isActive:active"]
 
+    init: ->
+        @_super()
+        @didRouteChange()
+
+    didRouteChange: (->
+        linkTo = @get('content.linkTo')
+        return unless linkTo?
+        itemsView = @get('parentView')
+        return unless itemsView?
+        if @get('router')?.isActive(linkTo)
+            itemsView.set('selected', @get('value'))
+    ).observes('router.url')
+
     ###
     Determine whether the current item is selected,
     if true the 'active' css class will be associated with the this DOM's element.

    in the parent ItemsView.
    ###
    isActive: (->
        #activate default tab if current route matches a tab route
        if @get('content.linkTo')
            return true if @get('content.linkTo') and @get('router')?.isActive(@get('content.linkTo'))

        #TODO: Ensure parentView is inherited from ItemsView
        itemsView = @get('parentView')
        if not itemsView?

        if typeof(content) is 'object'
            return if content.get('disabled')

        # items with linkTo will be dispatched in didRouteChange
        return if @get('content.linkTo')?

        #Currently multi selection is not supported
        itemsView.set('selected', @get('value'))
)
