class @Mercury.Statusbar
constructor: (@options = {}) ->
@build()
@bindEvents()
build: ->
@element = jQuery('
', {class: 'mercury-statusbar'}).appendTo(jQuery(@options.appendTo).get(0) ? 'body')
bindEvents: ->
Mercury.bind 'region:update', (event, options) =>
@setPath(options.region.path()) if options.region && jQuery.type(options.region.path) == 'function'
height: ->
return @element.outerHeight()
top: ->
return @element.offset().top
setPath: (elements) ->
path = []
path.push("
#{element.tagName.toLowerCase()}") for element in elements
@element.html("
Path: #{path.reverse().join(' » ')}")