aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/redbasic/js/redbasic.js
diff options
context:
space:
mode:
Diffstat (limited to 'view/theme/redbasic/js/redbasic.js')
-rw-r--r--view/theme/redbasic/js/redbasic.js78
1 files changed, 54 insertions, 24 deletions
diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js
index 81a95c68b..04199ea95 100644
--- a/view/theme/redbasic/js/redbasic.js
+++ b/view/theme/redbasic/js/redbasic.js
@@ -16,14 +16,27 @@ $(document).ready(function() {
}
$('#css3-calc').remove(); // Remove the test element
- if($(window).width() > 767) {
+ if($(window).width() >= 767) {
$('#left_aside_wrapper').stick_in_parent({
- offset_top: $('nav').outerHeight(true),
- parent: '#region_1',
+ offset_top: parseInt($('aside').css('padding-top')),
+ parent: 'main',
spacer: '#left_aside_spacer'
});
}
+ if($(window).width() >= 1200) {
+ $('#right_aside_wrapper').stick_in_parent({
+ offset_top: parseInt($('aside').css('padding-top')),
+ parent: 'main',
+ spacer: '#right_aside_spacer'
+ });
+ }
+
+
+ $('#notifications_wrapper.fs #notifications').stick_in_parent({
+ parent: '#notifications_wrapper'
+ });
+
$('#expand-aside').on('click', toggleAside);
$('section').on('click', function() {
@@ -41,29 +54,49 @@ $(document).ready(function() {
}
});
- if($('#left_aside_wrapper').length && $('#left_aside_wrapper').html().length === 0) {
- $('#expand-aside').hide();
- }
- $('#expand-tabs').click(function() {
- if(!$('#tabs-collapse-1').hasClass('in')){
- $('html, body').animate({ scrollTop: 0 }, 'slow');
+ var right_aside_height = $('#rightt_aside_wrapper').height();
+
+ $('#right_aside_wrapper').on('click', function() {
+ if(right_aside_height != $('#right_aside_wrapper').height()) {
+ $(document.body).trigger("sticky_kit:recalc");
+ right_aside_height = $('#right_aside_wrapper').height();
}
- $('#expand-tabs-icon').toggleClass('fa-arrow-circle-down').toggleClass('fa-arrow-circle-up');
});
- $('.usermenu-head').click(function() {
- if($('#navbar-collapse-1, #navbar-collapse-2').hasClass('in')){
- $('#navbar-collapse-1, #navbar-collapse-2').removeClass('in');
+ $('.usermenu').click(function() {
+ if($('#navbar-collapse-1, #navbar-collapse-2').hasClass('show')){
+ $('#navbar-collapse-1, #navbar-collapse-2').removeClass('show');
+ }
+ });
+
+ $('#menu-btn').click(function() {
+ if($('#navbar-collapse-1').hasClass('show')){
+ $('#navbar-collapse-1').removeClass('show');
+ }
+ });
+
+ $('#notifications-btn').click(function() {
+ if($('#navbar-collapse-2').hasClass('show')){
+ $('#navbar-collapse-2').removeClass('show');
+ }
+ });
+
+ var notifications_parent = $('#notifications_wrapper')[0].parentElement.id;
+ $('#notifications-btn').click(function() {
+ if($('#notifications_wrapper').hasClass('fs'))
+ $('#notifications_wrapper').prependTo('#' + notifications_parent);
+ else
+ $('#notifications_wrapper').prependTo('section');
+
+ $('#notifications_wrapper').toggleClass('fs');
+ if($('#navbar-collapse-2').hasClass('show')){
+ $('#navbar-collapse-2').removeClass('show');
}
});
-
- if($('#tabs-collapse-1').length === 0) {
- $('#expand-tabs').hide();
- }
$("input[data-role=cat-tagsinput]").tagsinput({
- tagClass: 'label label-primary'
+ tagClass: 'badge badge-pill badge-warning text-dark'
});
var doctitle = document.title;
@@ -81,17 +114,14 @@ $(document).ready(function() {
function makeFullScreen(full) {
if(typeof full=='undefined' || full == true) {
- $('main').css({'transition': 'none'}).addClass('fullscreen');
- $('header, nav, aside, #fullscreen-btn').hide();
- $('#tabs-collapse-1').css({'visibility': 'hidden'});
+ $('main').addClass('fullscreen');
+ $('header, nav, aside, #fullscreen-btn').attr('style','display:none !important');
$('#inline-btn').show();
}
else {
$('main').removeClass('fullscreen');
$('header, nav, aside, #fullscreen-btn').show();
- $('#tabs-collapse-1').css({'visibility': ''});
$('#inline-btn').hide();
- $('main').css({'transition': ''});
$(document.body).trigger("sticky_kit:recalc");
}
}
@@ -109,7 +139,7 @@ function toggleAside() {
$('main').addClass('region_1-on')
$('<div id="overlay"></div>').appendTo('section');
$('#left_aside_wrapper').stick_in_parent({
- offset_top: $('nav').outerHeight(true) - 10,
+ offset_top: $('nav').outerHeight(true) + 10,
parent: '#region_1',
spacer: '#left_aside_spacer'
});