Skip to content

Commit

Permalink
highligh page
Browse files Browse the repository at this point in the history
  • Loading branch information
zamiang committed Aug 11, 2015
1 parent 858dbf3 commit dad1fe7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/app.coffee
@@ -0,0 +1 @@
require("../components/layout/header/index.coffee").init()
9 changes: 9 additions & 0 deletions components/layout/header/index.coffee
@@ -0,0 +1,9 @@
module.exports.init = ->
$header = $('.vislet-intro')
return unless $header.length > 0
pathName = window.location.pathname.replace(/\/$/, "")
$header.find('.items a').each (index, item) ->
$item = $(item)
href = $item.attr 'href'
if href == pathName
$item.addClass 'active'
2 changes: 1 addition & 1 deletion components/layout/header/intro.jade
Expand Up @@ -4,4 +4,4 @@
.items
a.faux-underline-hover( href="/brooklyn" ) Brookyln Residential Sales
a.faux-underline-hover( href="/311" ) NYC 311 Calls
a.faux-underline-hover( href="/Chicago" ) Chicago Crime
a.faux-underline-hover( href="/chicago" ) Chicago Crime
3 changes: 3 additions & 0 deletions components/layout/stylesheets/index.styl
Expand Up @@ -40,6 +40,9 @@ html.wf-active body
&:before
border-color: $border-color

.faux-underline-hover.active:before
border-color: $highlight

h1, h2, h3, h4, h5, h6
margin: 0 0 20px

Expand Down
2 changes: 1 addition & 1 deletion components/layout/templates/index.jade
Expand Up @@ -17,4 +17,4 @@ html
script( src='/js/' + assetPackage + JS_EXT )
block scripts
include ../footer/template

script( src='/js/app' + JS_EXT )

0 comments on commit dad1fe7

Please sign in to comment.