 define (require) ->
   _ = require('underscore')
   Backbone = require('backbone')
+  router = require('cs!router')
   BaseView = require('cs!helpers/backbone/views/base')
   #MailPopoverView = require('cs!./popovers/mail/mail')
   template = require('hbs!./title-template')

    template: template
    templateHelpers: () ->
      title = @model.get('title')
      currentPage = @model.get('currentPage')
      if currentPage
        # Set information used for social media links
        share =
          url: Backbone.history.fragment
          source: @model.get('source') or currentPage.get('source') or 'OpenStax College'
          summary: @model.get('summary') or currentPage.get('summary') or 'An OpenStax College book.'
          title: title or currentPage.get('title')
          image: @model.get('image') or currentPage.get('image') or "#{Backbone.history.location.host}/images/logo.png"

      # Encode all of the shared values for a URI
      _.each share, (value, key, list) ->


    initialize: () ->
      super()
      @listenTo(@model, 'change:title', @render)
      @listenTo(router, 'navigate', @render)

    #onRender: () ->
    #  $share = @$el.find('.share')
