Replace jQuery slidedown() function
This commit is contained in:
parent
e40c931cf7
commit
cc208ff195
|
@ -429,6 +429,18 @@ const replace = (oldElement, newHTMLString) => {
|
|||
removeExtraInputs();
|
||||
}
|
||||
|
||||
const slideDownJS = (element) => {
|
||||
if (element.classList.contains('slide-down'))
|
||||
return;
|
||||
|
||||
element.classList.add('slide-down');
|
||||
const cs = getComputedStyle(element);
|
||||
const paddingHeight = parseInt(cs.paddingTop) + parseInt(cs.paddingBottom);
|
||||
const height = (element.clientHeight - paddingHeight) + 'px';
|
||||
element.style.height = '0px';
|
||||
setTimeout(() => { element.style.height = height; }, 0);
|
||||
};
|
||||
|
||||
const fetchWithCSRF = (url, params) => {
|
||||
let csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
||||
params = params || {};
|
||||
|
|
|
@ -1115,9 +1115,13 @@ div#story_box input#story_moderation_reason,
|
|||
div#story_box input#story_merge_story_short_id {
|
||||
width: 600px;
|
||||
}
|
||||
div#story_box .title-reminder {
|
||||
#story_box .title-reminder {
|
||||
display: none;
|
||||
}
|
||||
.slide-down {
|
||||
display: block !important;
|
||||
transition: height .5s ease !important;
|
||||
}
|
||||
div#story_box #story_tags_a {
|
||||
width: 624px;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue