2015-03-15 21:18:59 +00:00
|
|
|
/**
|
|
|
|
* redbasic theme specific JavaScript
|
|
|
|
*/
|
2012-11-07 22:09:51 +00:00
|
|
|
$(document).ready(function() {
|
2016-03-02 11:31:25 +00:00
|
|
|
|
2015-03-15 21:18:59 +00:00
|
|
|
// CSS3 calc() fallback (for unsupported browsers)
|
|
|
|
$('body').append('<div id="css3-calc" style="width: 10px; width: calc(10px + 10px); display: none;"></div>');
|
|
|
|
if( $('#css3-calc').width() == 10) {
|
|
|
|
$(window).resize(function() {
|
|
|
|
if($(window).width() < 767) {
|
2016-12-19 11:46:36 +00:00
|
|
|
$('main').css('width', $(window).width() + $('aside').outerWidth() );
|
2015-03-15 21:18:59 +00:00
|
|
|
} else {
|
|
|
|
$('main').css('width', '100%' );
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$('#css3-calc').remove(); // Remove the test element
|
2012-11-07 22:09:51 +00:00
|
|
|
|
2016-12-22 14:01:29 +00:00
|
|
|
if($(window).width() > 767) {
|
|
|
|
$('#left_aside_wrapper').stick_in_parent({
|
2017-01-05 16:40:45 +00:00
|
|
|
offset_top: $('nav').outerHeight(true),
|
|
|
|
parent: '#region_1',
|
|
|
|
spacer: '#left_aside_spacer'
|
2016-12-22 14:01:29 +00:00
|
|
|
});
|
|
|
|
}
|
2016-12-16 15:14:01 +00:00
|
|
|
|
2016-12-19 11:46:36 +00:00
|
|
|
$('#expand-aside').on('click', toggleAside);
|
|
|
|
|
|
|
|
$('section').on('click', function() {
|
|
|
|
if($('main').hasClass('region_1-on')){
|
|
|
|
toggleAside();
|
2016-12-16 15:14:01 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-01-03 16:56:40 +00:00
|
|
|
var left_aside_height = $('#left_aside_wrapper').height();
|
|
|
|
|
|
|
|
$('#left_aside_wrapper').on('click', function() {
|
|
|
|
if(left_aside_height != $('#left_aside_wrapper').height()) {
|
|
|
|
$(document.body).trigger("sticky_kit:recalc");
|
|
|
|
left_aside_height = $('#left_aside_wrapper').height();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-12-31 11:55:10 +00:00
|
|
|
if($('#left_aside_wrapper').length && $('#left_aside_wrapper').html().length === 0) {
|
2015-03-15 21:18:59 +00:00
|
|
|
$('#expand-aside').hide();
|
2014-03-25 14:27:45 +00:00
|
|
|
}
|
2014-03-19 08:43:23 +00:00
|
|
|
|
2015-03-15 21:18:59 +00:00
|
|
|
$('#expand-tabs').click(function() {
|
|
|
|
if(!$('#tabs-collapse-1').hasClass('in')){
|
|
|
|
$('html, body').animate({ scrollTop: 0 }, 'slow');
|
|
|
|
}
|
2016-04-30 19:59:02 +00:00
|
|
|
$('#expand-tabs-icon').toggleClass('fa-arrow-circle-down').toggleClass('fa-arrow-circle-up');
|
2015-03-15 21:18:59 +00:00
|
|
|
});
|
2014-03-19 08:43:23 +00:00
|
|
|
|
2016-11-04 20:29:23 +00:00
|
|
|
$('.usermenu-head').click(function() {
|
2016-11-04 01:01:18 +00:00
|
|
|
if($('#navbar-collapse-1').hasClass('in')){
|
|
|
|
$('#navbar-collapse-1').removeClass('in');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-03-15 21:18:59 +00:00
|
|
|
if($('#tabs-collapse-1').length === 0) {
|
|
|
|
$('#expand-tabs').hide();
|
|
|
|
}
|
2015-03-27 10:52:59 +00:00
|
|
|
|
|
|
|
$("input[data-role=cat-tagsinput]").tagsinput({
|
|
|
|
tagClass: 'label label-primary'
|
|
|
|
});
|
2012-11-07 22:09:51 +00:00
|
|
|
|
2013-07-22 01:34:15 +00:00
|
|
|
var doctitle = document.title;
|
|
|
|
function checkNotify() {
|
|
|
|
var notifyUpdateElem = document.getElementById('notify-update');
|
2013-07-22 01:44:24 +00:00
|
|
|
if(notifyUpdateElem !== null) {
|
2015-03-15 21:18:59 +00:00
|
|
|
if(notifyUpdateElem.innerHTML !== "")
|
|
|
|
document.title = "(" + notifyUpdateElem.innerHTML + ") " + doctitle;
|
|
|
|
else
|
|
|
|
document.title = doctitle;
|
2013-07-22 01:34:15 +00:00
|
|
|
}
|
2015-03-15 21:18:59 +00:00
|
|
|
}
|
2013-07-22 01:34:15 +00:00
|
|
|
setInterval(function () {checkNotify();}, 10 * 1000);
|
2015-03-27 10:52:59 +00:00
|
|
|
});
|
2016-04-01 06:56:51 +00:00
|
|
|
|
|
|
|
function makeFullScreen(full) {
|
|
|
|
if(typeof full=='undefined' || full == true) {
|
2016-04-03 16:00:03 +00:00
|
|
|
$('main').css({'transition': 'none'}).addClass('fullscreen');
|
2016-07-16 08:52:06 +00:00
|
|
|
$('header, nav, aside, #fullscreen-btn').hide();
|
|
|
|
$('#tabs-collapse-1').css({'visibility': 'hidden'});
|
2016-04-02 22:04:05 +00:00
|
|
|
$('#inline-btn').show();
|
2016-04-01 06:56:51 +00:00
|
|
|
}
|
|
|
|
else {
|
2016-04-03 16:00:03 +00:00
|
|
|
$('main').removeClass('fullscreen');
|
2016-07-16 08:56:46 +00:00
|
|
|
$('header, nav, aside, #fullscreen-btn').show();
|
2016-07-16 08:52:06 +00:00
|
|
|
$('#tabs-collapse-1').css({'visibility': ''});
|
2016-07-16 08:56:46 +00:00
|
|
|
$('#inline-btn').hide();
|
2016-04-02 22:04:05 +00:00
|
|
|
$('main').css({'transition': ''});
|
2016-12-16 15:24:17 +00:00
|
|
|
$(document.body).trigger("sticky_kit:recalc");
|
2016-04-01 06:56:51 +00:00
|
|
|
}
|
|
|
|
}
|
2016-12-19 11:46:36 +00:00
|
|
|
|
|
|
|
function toggleAside() {
|
|
|
|
$('#expand-aside-icon').toggleClass('fa-arrow-circle-right').toggleClass('fa-arrow-circle-left');
|
2016-12-22 10:54:04 +00:00
|
|
|
if($('main').hasClass('region_1-on')){
|
2017-01-13 12:04:30 +00:00
|
|
|
$('html, body').css('overflow-x', '');
|
2016-12-22 10:54:04 +00:00
|
|
|
$('main').removeClass('region_1-on')
|
|
|
|
$('#overlay').remove();
|
2016-12-22 13:55:05 +00:00
|
|
|
$('#left_aside_wrapper').trigger("sticky_kit:detach");
|
2016-12-22 10:54:04 +00:00
|
|
|
}
|
|
|
|
else {
|
2017-01-13 12:04:30 +00:00
|
|
|
$('html, body').css('overflow-x', 'hidden');
|
2016-12-22 10:54:04 +00:00
|
|
|
$('main').addClass('region_1-on')
|
|
|
|
$('<div id="overlay"></div>').appendTo('section');
|
2016-12-22 13:55:05 +00:00
|
|
|
$('#left_aside_wrapper').stick_in_parent({
|
2017-01-05 16:54:44 +00:00
|
|
|
offset_top: $('nav').outerHeight(true) - 10,
|
|
|
|
parent: '#region_1',
|
|
|
|
spacer: '#left_aside_spacer'
|
2016-12-22 13:55:05 +00:00
|
|
|
});
|
2016-12-22 10:54:04 +00:00
|
|
|
}
|
2016-12-19 11:46:36 +00:00
|
|
|
}
|