Rinser/html/js/shell.js

47 lines
1006 B
JavaScript
Raw Normal View History

2016-03-15 11:33:52 +00:00
"use strict";
jQuery(function($) {
var $bodyEl = $('body'),
$sidedrawerEl = $('#sidedrawer');
function showSidedrawer() {
// show overlay
var options = {
onclose: function() {
$sidedrawerEl
.removeClass('active')
.appendTo(document.body);
}
};
var $overlayEl = $(mui.overlay('on', options));
// show element
$sidedrawerEl.appendTo($overlayEl);
setTimeout(function() {
$sidedrawerEl.addClass('active');
}, 20);
}
function hideSidedrawer() {
$bodyEl.toggleClass('hide-sidedrawer');
}
$('.js-show-sidedrawer').on('click', showSidedrawer);
$('.js-hide-sidedrawer').on('click', hideSidedrawer);
});
2016-03-15 13:15:41 +00:00
var $titleEls = $('strong', $('#sidedrawer'));
2016-03-15 11:33:52 +00:00
$titleEls
.next()
.hide();
$titleEls.on('click', function() {
$(this).next().slideToggle(200);
});/**
* Created by Martin on 24/02/2016.
*/