Sha256: f45f1a6b5e7990546133146dfd6f2649b5ef03c5f8cd13088a06638059cfefc7

Contents?: true

Size: 640 Bytes

Versions: 2

Compression:

Stored size: 640 Bytes

Contents

class @Mercury.Statusbar

  constructor: (@options = {}) ->
    @build()
    @bindEvents()


  build: ->
    @element = $('<div>', {class: 'mercury-statusbar'}).appendTo($(@options.appendTo).get(0) ? 'body')


  bindEvents: ->
    Mercury.bind 'region:update', (event, options) =>
      @setPath(options.region.path()) if options.region && $.type(options.region.path) == 'function'


  height: ->
    @element.outerHeight()


  setPath: (elements) ->
    path = []
    path.push("<a>#{element.tagName.toLowerCase()}</a>") for element in elements

    @element.html("<span><strong>Path: </strong></span>#{path.reverse().join(' &raquo; ')}")

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mercury-rails-0.1.1 app/assets/javascripts/mercury/statusbar.js.coffee
mercury-rails-0.1.0 app/assets/javascripts/mercury/statusbar.js.coffee