diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8e1fa6ff3..baebffef4 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -292,7 +292,7 @@ document.addEventListener("turbolinks:load", function(e) { return true; } this.dataset.origHeight = this.clientHeight; - this.style.maxHeight = '' + limit + 'px'; + this.style.maxHeight = '' + (limit - 50) + 'px'; this.classList.add('tess-expandable-closed'); const btn = $('Show more'); btn.insertAfter($(this)); @@ -379,13 +379,14 @@ $(document).on('click', '.tess-expandable-btn', function (event) { return false; } - const maxHeight = parseInt(div.dataset.origHeight) + 80; + const maxHeight = parseInt(div.dataset.origHeight) + 120; const limit = parseInt(div.dataset.heightLimit || "300"); if (div.classList.contains('tess-expandable-closed')) { div.classList.add('tess-expandable-open'); div.classList.remove('tess-expandable-closed'); div.style.maxHeight = '' + maxHeight + 'px'; + setTimeout(() => div.style.maxHeight = null, 500); this.innerHTML = 'Show less'; } else { div.classList.remove('tess-expandable-open');