From 9e42be988408e0b4c7cff57c3923c73f6756e861 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 13 Sep 2023 15:51:10 +0000 Subject: theme fixes --- view/theme/redbasic/js/redbasic.js | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'view/theme/redbasic/js') diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 706bf2808..c288c8b92 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -8,20 +8,15 @@ let redbasic_theme_color = localStorage.getItem('redbasic_theme_color'); if (redbasic_dark_mode == 1) { $('html').attr('data-bs-theme', 'dark'); } + if (redbasic_dark_mode == 0) { $('html').attr('data-bs-theme', 'light'); } - - - - if (redbasic_theme_color) { $('meta[name=theme-color]').attr('content', redbasic_theme_color); } - - $(document).ready(function() { // provide a fake progress bar for pwa standalone mode if (window.matchMedia('(display-mode: standalone)').matches) { @@ -69,15 +64,6 @@ $(document).ready(function() { stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_3')).getPropertyValue('padding-top')), 20); } - $('#expand-aside').on('click', function() { - if($('main').hasClass('region_1-on')){ - toggleAside('left'); - } - else { - toggleAside('right'); - } - }); - $('.usermenu').click(function() { if($('#navbar-collapse-1, #navbar-collapse-2').hasClass('show')){ $('#navbar-collapse-1, #navbar-collapse-2').removeClass('show'); @@ -168,7 +154,7 @@ $(document).ready(function() { if (touch_end > (touch_start + touch_offset)) { //a left -> right swipe if (touch_start < touch_max) { - toggleAside('right'); + toggleAside(); } } if (touch_end < (touch_start - touch_offset)) { @@ -178,10 +164,6 @@ $(document).ready(function() { } }); - $(document).on('hz:hqControlsClickAction', function(e) { - toggleAside('left'); - }); - }); function setStyle(element, cssProperty) { @@ -255,18 +237,4 @@ function makeFullScreen(full) { } } -function toggleAside(swipe) { - if ($('main').hasClass('region_1-on') && swipe === 'left') { - $('#expand-aside-icon').addClass('fa-arrow-circle-right').removeClass('fa-arrow-circle-left'); - $('html, body').css({ 'position': '', left: '' }); - $('main').removeClass('region_1-on'); - $('#overlay').remove(); - } - if (!$('main').hasClass('region_1-on') && swipe === 'right') { - $('#expand-aside-icon').removeClass('fa-arrow-circle-right').addClass('fa-arrow-circle-left'); - $('html, body').css({ 'position': 'sticky', 'left': '0px'}); - $('main').addClass('region_1-on'); - $('
').appendTo('body').one('click', function() { toggleAside('left'); }); - } -} -- cgit v1.2.3 From 8a21c8e618023cc0fb35a843697871649610b079 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 13 Sep 2023 20:56:27 +0000 Subject: more theme fixes --- view/theme/redbasic/js/redbasic.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'view/theme/redbasic/js') diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index c288c8b92..28fb73845 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -57,11 +57,11 @@ $(document).ready(function() { if (document.querySelector('#region_1')) { - stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_1')).getPropertyValue('padding-top')), 0); + stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20); } if (document.querySelector('#region_3')) { - stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', '.content', parseFloat(window.getComputedStyle(document.querySelector('#region_3')).getPropertyValue('padding-top')), 20); + stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20); } $('.usermenu').click(function() { @@ -211,12 +211,12 @@ function stickyScroll(sticky, stickyTop, container, topOffset, bottomOffset) { setStyle(sticky, { position: 'sticky', top: Math.round(diff) - bottomOffset + 'px', bottom: '' }); } else { // upscroll code - h = sticky.getBoundingClientRect().top - content.getBoundingClientRect().top - topOffset; + h = sticky.getBoundingClientRect().top - content.getBoundingClientRect().top; if(Math.round(stickyTop.getBoundingClientRect().height) === lasth) { setStyle(stickyTop, { height: Math.round(h) + 'px' }); } lasth = Math.round(h); - setStyle(sticky, { position: 'sticky', top: '', bottom: Math.round(diff - topOffset) + 'px' }); + setStyle(sticky, { position: 'sticky', top: '', bottom: Math.round(diff) - topOffset + 'px' }); } lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling } -- cgit v1.2.3 From 526c85e2ca5f4ab60b6a922f4829f3d8126a6571 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 14 Sep 2023 10:00:24 +0000 Subject: fix minor regression after recent changes --- view/theme/redbasic/js/redbasic.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'view/theme/redbasic/js') diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 28fb73845..4ad3665fe 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -134,7 +134,7 @@ $(document).ready(function() { //just one finger touched touch_start = e.touches.item(0).clientX; if (touch_start < touch_max) { - $('html, body').css('overflow-y', 'hidden'); + $('body').css('overflow-y', 'hidden'); } } else { @@ -144,7 +144,7 @@ $(document).ready(function() { }); window.addEventListener('touchend', function(e) { - $('html, body').css('overflow-y', ''); + $('body').css('overflow-y', ''); let touch_offset = 30; //at least 30px are a swipe if (touch_start) { @@ -159,7 +159,6 @@ $(document).ready(function() { } if (touch_end < (touch_start - touch_offset)) { //a right -> left swipe - //toggleAside('left'); } } }); -- cgit v1.2.3 From 5265c774ae5917b5200510e668f8182eb07af750 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 4 Oct 2023 21:00:00 +0200 Subject: move right aside into bottom of left aside if screen width is < 1200px --- view/theme/redbasic/js/redbasic.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'view/theme/redbasic/js') diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 4ad3665fe..0f2617cc0 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -55,6 +55,11 @@ $(document).ready(function() { } $('#css3-calc').remove(); // Remove the test element + if($(window).width() < 1200) { + $("#right_aside_wrapper").children().detach().appendTo('#left_aside_wrapper'); + $('#notifications_wrapper').addClass('d-none'); + } + if (document.querySelector('#region_1')) { stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20); -- cgit v1.2.3