remove some obsolete JS

This commit is contained in:
rimu 2024-07-05 16:14:24 +08:00
parent bd3da38ff9
commit cb614b1394
2 changed files with 2 additions and 43 deletions

View file

@ -127,7 +127,6 @@ function setupLightboxTeaser() {
// fires after all resources have loaded, including stylesheets and js files // fires after all resources have loaded, including stylesheets and js files
window.addEventListener("load", function () { 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(); 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() { function setupHideButtons() {
const hideEls2 = document.querySelectorAll('.hide_button a'); const hideEls2 = document.querySelectorAll('.hide_button a');

View file

@ -1430,13 +1430,11 @@ h1 .warning_badge {
#baguetteBox-overlay { #baguetteBox-overlay {
overflow: scroll !important; overflow: scroll !important;
} }
#baguetteBox-overlay .full-image { #baguetteBox-overlay .full-image {
height: auto !important; height: auto !important;
} }
#baguetteBox-overlay .full-image figure { #baguetteBox-overlay .full-image figure {
display: inline-block !important; display: inline-block !important;
} }
#baguetteBox-slider { #baguetteBox-slider {