mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-05-25 18:11:47 +08:00
将 layout.jade 中的 JS 抽取到 layout.coffee
This commit is contained in:
4
core/static/script/layout.coffee
Normal file
4
core/static/script/layout.coffee
Normal file
@@ -0,0 +1,4 @@
|
||||
$ ->
|
||||
$('nav a').each (index) ->
|
||||
if $('nav a')[index].pathname == location.pathname
|
||||
$($('nav a')[index]).parent().addClass('active')
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user