Created
May 28, 2012 15:25
-
-
Save inossidabile/2819730 to your computer and use it in GitHub Desktop.
Joosy / Blog / Elements, Events and Filters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# layouts/application.js.coffee | |
class @ApplicationLayout extends Joosy.Layout | |
@view 'application' | |
elements: | |
'navigationBar': '.navbar' | |
'clocks': '.navbar .pull-right a' | |
events: | |
'mouseenter $navigationBar': 'showClocks' | |
'mouseleave $navigationBar': 'hideClocks' | |
showClocks: -> @clocks.show() | |
hideClocks: -> @clocks.hide() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# layouts/application.js.coffee | |
class @ApplicationLayout extends Joosy.Layout | |
@view 'application' | |
elements: | |
'navigationBar': '.navbar' | |
'clocks': '.navbar .pull-right a' | |
events: | |
'mouseenter $navigationBar': -> @clocks.show() | |
'mouseleave $navigationBar': -> @clocks.hide() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@afterLoad -> | |
updateClocks = => | |
@clocks.html new Date().format('{dd} {Mon} {yyyy}, {hh}:{mm}:{ss}') | |
updateClocks() | |
@setInterval 1000, updateClocks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@beforeLoad -> | |
@navigate('/') && return false unless window.currentUser | |
true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.navbar.navbar-fixed-top | |
.navbar-inner | |
.container | |
%ul.nav.pull-right | |
%li | |
%a | |
24 May 2012, 19:24:00 | |
%a.brand{:href => '#!/'} | |
Joosy Blog | |
%ul.nav | |
%li.divider-vertical | |
%li | |
%a{:href => '#!/posts/new'} Write something | |
.container{:id => @yield()} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, the indentation disappeared in the coffeescript code above.