tripleo-docs/_custom/expandable.js
Emilien Macchi 3da7042c24 Basic structure of TripleO Deployment Guide
* Move _custom & _templates at root, so both doc/ and deploy-guide/
  can use it.
* Update tox.ini to generate deploy-guide.
* Very basic structure of deploy-guide.
* Removing duplicated _templates parameter from config.py.

Change-Id: Id7b4c22d188fd4f2646ec25194767c3a7afa97c7
2017-03-27 08:00:12 -04:00

33 lines
903 B
JavaScript

$(document).ready(function() {
// for each trigger
$('.trigger').each(function() {
// check if cookie has value on true
if ($.cookie($(this).parent().prop('id')) == "true") {
// add displayed class and show the content
$(this).parent().addClass("displayed");
$(this).next('.content').show();
} else {
// remove displayed class and hide the content
$(this).parent().removeClass("displayed");
$(this).next('.content').hide();
}
});
// if user clicked trigger element
$('.trigger').click(function() {
// toggle parent's class and animate the content
$(this).parent().toggleClass('displayed');
$(this).next('.content').slideToggle("fast");
// save the state to cookies
var parent_id =
$.cookie($(this).parent().prop('id'),
$(this).parent().hasClass('displayed'),
{ path: '/' });
});
});