class @AttentionIndicator

  constructor: (id, text = "", css_class = null) ->

    @item = $("##{id}")
    @text = text
    @css_class = css_class
    
    @create_indicator()
    @append_text()
    @add_class()
    @append_indicator()

  create_indicator: ->
    @indicator = $("<span />").addClass("badge")

  append_text: ->
    @indicator.text(@text)

  add_class: ->
    if @css_class != null
      @indicator.addClass(@css_class)

  append_indicator: ->
    @item.find("i").replaceWith(@indicator)
