mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-19 07:54:16 +02:00
Remove inline show more
This commit is contained in:
parent
0bcc9ca43a
commit
309b403925
3 changed files with 173 additions and 185 deletions
|
@ -562,6 +562,7 @@ function enableRelatedWidgetButtons(changeLink, deleteLink, viewLink, elementPk,
|
||||||
let descriptionDiv = document.querySelector('.dja__model-description');
|
let descriptionDiv = document.querySelector('.dja__model-description');
|
||||||
|
|
||||||
if (toggleButton && descriptionDiv) {
|
if (toggleButton && descriptionDiv) {
|
||||||
|
|
||||||
toggleButton.addEventListener('click', function() {
|
toggleButton.addEventListener('click', function() {
|
||||||
// Toggle the class on the description div
|
// Toggle the class on the description div
|
||||||
descriptionDiv.classList.toggle('dja__model-description--no-overflow');
|
descriptionDiv.classList.toggle('dja__model-description--no-overflow');
|
||||||
|
@ -569,12 +570,8 @@ function enableRelatedWidgetButtons(changeLink, deleteLink, viewLink, elementPk,
|
||||||
// Change the button text based on the presence of the class
|
// Change the button text based on the presence of the class
|
||||||
if (descriptionDiv.classList.contains('dja__model-description--no-overflow')) {
|
if (descriptionDiv.classList.contains('dja__model-description--no-overflow')) {
|
||||||
toggleButton.textContent = 'Show less';
|
toggleButton.textContent = 'Show less';
|
||||||
|
|
||||||
// Move the div to where it was when the page first loaded
|
|
||||||
descriptionDiv.appendChild(toggleButton);
|
|
||||||
} else {
|
} else {
|
||||||
toggleButton.textContent = 'Show more';
|
toggleButton.textContent = 'Show more';
|
||||||
descriptionDiv.insertAdjacentElement('afterend', toggleButton);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -636,15 +636,7 @@ div.dja__model-description{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dja__model-description + button {
|
|
||||||
margin-top: 25px !important;
|
|
||||||
height: 10px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.dja__model-description.dja__model-description--no-overflow {
|
div.dja__model-description.dja__model-description--no-overflow {
|
||||||
display: block;
|
display: block;
|
||||||
overflow: unset;
|
overflow: unset;
|
||||||
button {
|
|
||||||
margin-top: unset;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<span class="display-inline-flex">
|
|
||||||
<div class="dja__model-description text-normal">
|
<div class="dja__model-description text-normal">
|
||||||
{% if opts.model_name == 'domainrequest' %}
|
{% if opts.model_name == 'domainrequest' %}
|
||||||
<p>
|
<p>
|
||||||
|
@ -184,5 +184,4 @@
|
||||||
<p>This table does not have a description yet.</p>
|
<p>This table does not have a description yet.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<button id="dja-show-more-model-description" class="usa-button usa-button--unstyled text-no-underline" type="button">Show more</button>
|
<button id="dja-show-more-model-description" class="usa-button usa-button--unstyled text-no-underline margin-top-1" type="button">Show more</button>
|
||||||
</span>
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue