Sha256: 6529d2782ad991f9c2868965a2a69380aceee21af2e7bdd5125a165fbd339f98

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

#hashCode = (val) ->
#  hash = 0
#  return hash if (val.length == 0)
#
#  for i in [0..val.length]
#    do (i) ->
#      char = this.charCodeAt(i)
#      hash = ((hash<<5)-hash) + char
#      hash = hash & hash # Convert to 32bit integer
#
#  return hash;
#
#
#
#breadcrumb_id = (val) ->
#  hasCode(val)

class Breadcrumbs
  @mark_active_menu_items: ->
    $('a[data-breadcrumb_id]').each (index, element) =>
      $(element).parent('li').removeClass('active')

    $('.breadcrumb li').each (index, element) =>
      bc = $(element)
      href = bc.find('a')
      if href.length > 0
        Breadcrumbs.mark_menu_item(href.html())
      else
        Breadcrumbs.mark_menu_item(bc.html())

  @mark_menu_item: (val) ->
    finding_string = "a[data-breadcrumb_id='" + val + "']"
    found = $(finding_string)
    found.parent('li').addClass('active') if found

window.Breadcrumbs = Breadcrumbs

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
it-logica-application-backbone-0.2.17 app/assets/javascripts/backbone_js/ladas_breadcrumb.js.coffee