Conversation
Fix + sign in collapse Fix only truncate first description Use cset to avoid duplication (efficiency?)
|
Hello @qqmyers! I tried testing this out, but it seems like it did not work. While trying to dig around to see what the problem was, I noticed that that while I was on a Dataverse page, in Sources Tab of Chrome Developer Tools -> javax.faces.resource -> js -> dv_rebind_bootstrap_ui.js.xhtml?version=5.12.1 was not the same as dv_rebind_bootstrap_ui.js in the source code. I am not sure why this is the case, but in dataverse_template.xhtml, To my understanding, it seems like the wrong version of dv_rebind_bootstrap_ui.js is being called in dataverse_template.xhtml? |
|
I think this is a caching issue in the browser. The idea of putting the ?version=X at the end avoids it for non-developers - when v5.13 comes out, the browser will auto-update it in users browser. Unfortunately, when we make a change to the script in development and the version doesn't change, your browser doesn't know to update. The work-around is to open that script in a separate pane and do the SHIFT-refresh to force the browser to get a new copy. After that the Dataverse pages will get the updated version. |
|
Got it, thanks! That fixed the issue. |
|
@qqmyers thanks for showing the way to me and @ar062800 I'm going to go ahead and close this PR now that I've approved his: |

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.localeTitlemultiple 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: