CoffeeScript
Ruby
code posted
by
Ade
created at 21 Feb 16:54
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
class SubFilters extends Filters constructor: () -> @container = "#container" @list = ".blog .filters li" @links = ".blog .filters li a" @css = "selected" @main_filters = "#blog_filters .filters li a" # @heading = "Case studies - Loading" # @title = "#cs-title" @title_end = " | Adrian Stainforth ::: UX | Frontend | Backend" init: -> @add_click(); add_click: -> item = this # console.log($(@links)) $(@container).on "click", @links, -> url = $(this).attr('href') pt = item.pagetitle($(this).attr("title")) $.getScript(url) history.pushState({hist_test:true, pagetitle:pt}, pt, url) if (history && history.pushState) item.set_loader() item.set_highlighted(url) false set_highlighted: (url) -> $(@main_filters).each (i)-> if $(this).attr('href') == href $(this).parent().addClass("selected") |
957 Bytes in 5 ms with coderay