将 layout.jade 中的 JS 抽取到 layout.coffee

This commit is contained in:
jysperm
2014-02-14 22:04:12 +08:00
parent d49bca9689
commit 0949cc2985
2 changed files with 5 additions and 7 deletions

View File

@@ -0,0 +1,4 @@
$ ->
$('nav a').each (index) ->
if $('nav a')[index].pathname == location.pathname
$($('nav a')[index]).parent().addClass('active')

View File

@@ -46,10 +46,4 @@ html
#footer
script(src='http://cdn.staticfile.org/jquery/2.0.3/jquery.min.js')
script(src='http://cdn.staticfile.org/twitter-bootstrap/3.0.0-rc2/js/bootstrap.min.js')
script.
$(function() {
$('nav a').each(function(index) {
if($('nav a')[index].pathname == location.pathname)
$($('nav a')[index]).parent().addClass('active')
});
});
script(src='/script/layout.js')