Truncate Dataverse Description Text #9265
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This was developed as a possible alternative to #9222 . It makes changes to the contentTruncate function to allow it to be used in both the dataset and dataverse pages.
It also adds some possible fixes/improvements:
Collapse Description [+]
button shows a + sign like theRead full Description [+]
- I've changed that to use a minus signCollapse Description [-]
- I assume that was just a typo.DatasetPage.datasetVersionUI.description.datasetFieldType.localeTitle
multiple times - I'm guessing one cset and reuse of that variable is more efficient.The one thing that may be different is exactly where the page scrolls to when one re-collapses the description on a dataset page. The old code would have scrolled to the top of all descriptions whereas it will now scroll to the top of the description being collapsed. Since the old code would only collapse the first one, this should be a matter of a few pixels at most. (FWIW - the technical reason is that the truncSelector is reused in the contentTruncate function and my change means truncSelector points to the specific dataset description rather than the top of the element containing all descriptions. This could probably be fixed if desired - not sure it is worth it or that scrolling to the top of all descriptions makes sense now that all descriptions get truncated.)
Which issue(s) this PR closes:
Closes #1249
Special notes for your reviewer:
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: