mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-18 07:24:10 +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');
|
||||
|
||||
if (toggleButton && descriptionDiv) {
|
||||
|
||||
toggleButton.addEventListener('click', function() {
|
||||
// Toggle the class on the description div
|
||||
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
|
||||
if (descriptionDiv.classList.contains('dja__model-description--no-overflow')) {
|
||||
toggleButton.textContent = 'Show less';
|
||||
|
||||
// Move the div to where it was when the page first loaded
|
||||
descriptionDiv.appendChild(toggleButton);
|
||||
} else {
|
||||
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 {
|
||||
display: block;
|
||||
overflow: unset;
|
||||
button {
|
||||
margin-top: unset;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<span class="display-inline-flex">
|
||||
<div class="dja__model-description text-normal">
|
||||
|
||||
<div class="dja__model-description text-normal">
|
||||
{% if opts.model_name == 'domainrequest' %}
|
||||
<p>
|
||||
This table contains all domain requests that have been started within the registrar and the status of those requests.
|
||||
|
@ -183,6 +183,5 @@
|
|||
{% else %}
|
||||
<p>This table does not have a description yet.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<button id="dja-show-more-model-description" class="usa-button usa-button--unstyled text-no-underline" type="button">Show more</button>
|
||||
</span>
|
||||
</div>
|
||||
<button id="dja-show-more-model-description" class="usa-button usa-button--unstyled text-no-underline margin-top-1" type="button">Show more</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue