Add JS behaviors

This commit is contained in:
Riyad Preukschas 2012-10-29 18:24:25 +01:00
parent a58385247d
commit a048c955fd
4 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,5 @@
$ ->
$("body").on "click", ".js-details-target", ->
container = $(@).closest ".js-details-container"
container.toggleClass "open"

View file

@ -0,0 +1,5 @@
$ ->
$("body").on "click", ".js-toggler-target", ->
container = $(@).closest ".js-toggler-container"
container.toggleClass "on"

View file

@ -0,0 +1,14 @@
// Details
//--------
.js-details-container .content { display: none; }
.js-details-container .content.hide { display: block; }
.js-details-container.open .content { display: block; }
.js-details-container.open .content.hide { display: none; }
// Toggler
//--------
.js-toggler-container .turn-on { display: inline-block; }
.js-toggler-container .turn-off { display: none; }
.js-toggler-container.on .turn-on { display: none; }
.js-toggler-container.on .turn-off { display: inline-block; }

View file

@ -83,6 +83,11 @@ $baseLineHeight: 18px !default;
*/ */
@import "common.scss"; @import "common.scss";
/**
* Styles necessary to support JS behaviours.
*/
@import "behaviors.scss";
/** /**
* Styles related to specific part of app * Styles related to specific part of app
*/ */