From cb614b13947ba47ec69ef52203d4a18b2a6adf3e Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Fri, 5 Jul 2024 16:14:24 +0800 Subject: [PATCH] remove some obsolete JS --- app/static/js/scripts.js | 39 --------------------------------------- app/static/structure.css | 6 ++---- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/app/static/js/scripts.js b/app/static/js/scripts.js index 082cd1c9..3b17f4f1 100644 --- a/app/static/js/scripts.js +++ b/app/static/js/scripts.js @@ -127,7 +127,6 @@ function setupLightboxTeaser() { // fires after all resources have loaded, including stylesheets and js files window.addEventListener("load", function () { - setupPostTypeTabs(); // when choosing the type of your new post, store the chosen tab in a hidden field so the backend knows which fields to check setupHideButtons(); }); @@ -351,44 +350,6 @@ function setupCommunityNameInput() { } } -function setupPostTypeTabs() { - - const tabEl = document.querySelector('#discussion-tab') - if(tabEl) { - tabEl.addEventListener('show.bs.tab', event => { - document.getElementById('post_type ').value = 'discussion'; - }); - } - const tabE2 = document.querySelector('#link-tab') - if(tabE2) { - tabE2.addEventListener('show.bs.tab', event => { - document.getElementById('post_type').value = 'link'; - }); - } - const tabE3 = document.querySelector('#image-tab') - if(tabE3) { - tabE3.addEventListener('show.bs.tab', event => { - document.getElementById('post_type').value = 'image'; - }); - } - const tabE4 = document.querySelector('#poll-tab') - if(tabE4) { - tabE4.addEventListener('show.bs.tab', event => { - document.getElementById('post_type').value = 'poll'; - }); - } - // Check if there is a hidden field with the name 'type'. This is set if server-side validation of the form fails - var typeField = document.getElementById('post_type'); - if (typeField && typeField.tagName === 'INPUT' && typeField.type === 'hidden') { - var typeVal = typeField.value; - if(typeVal) { - const tab = document.getElementById(typeVal + '-tab'); - if(tab) - tab.click(); - } - } -} - function setupHideButtons() { const hideEls2 = document.querySelectorAll('.hide_button a'); diff --git a/app/static/structure.css b/app/static/structure.css index 6e629e8e..96053b80 100644 --- a/app/static/structure.css +++ b/app/static/structure.css @@ -1430,13 +1430,11 @@ h1 .warning_badge { #baguetteBox-overlay { overflow: scroll !important; } - #baguetteBox-overlay .full-image { - height: auto !important; + height: auto !important; } - #baguetteBox-overlay .full-image figure { - display: inline-block !important; + display: inline-block !important; } #baguetteBox-slider {