Skip to content

#8669 add bind to doc ready#8670

Merged
kcondon merged 4 commits intodevelopfrom
8669-tooltips-broken-on-add-data
May 4, 2022
Merged

#8669 add bind to doc ready#8670
kcondon merged 4 commits intodevelopfrom
8669-tooltips-broken-on-add-data

Conversation

@sekmiller
Copy link
Contributor

@sekmiller sekmiller commented Apr 29, 2022

What this PR does / why we need it: Fixes tool tips on Add Data (Dataverse or Dataset)

Which issue(s) this PR closes:

Closes #8669 Tool Tips not working on New Dataset and New Dataverse

Special notes for your reviewer: removed defer from the scripts required by the rebind (onload) method

Suggestions on how to test this: See that you get tool tips on New Dataset/ New Dataverse - also advanced search.

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:

@scolapasta scolapasta self-assigned this Apr 29, 2022
@sekmiller
Copy link
Contributor Author

sekmiller commented May 2, 2022

Upon further investigation I discovered that the onload script was running the rebind method, but that the rebind method was throwing errors and not running to completion. I put several try/catch blocks into the rebind method to see what the error messages were posting. Here is a sample:

`TypeError: $('.dropdown-toggle').dropdown is not a function. (In '$('.dropdown-toggle').dropdown()', '$('.dropdown-toggle').dropdown' is undefined)

Error: cannot call methods on tooltip prior to initialization; attempted to call method 'hide'

TypeError: $("[data-toggle='popover']").popover is not a function. (In '$("[data-toggle='popover']").popover({container: 'body'})', '$("[data-toggle='popover']").popover' is undefined)

TypeError: undefined is not a function (near '...$('#sharrre-widget').sharrre...')`

When the rebind is called from document.ready none of these errors occur.

@sekmiller
Copy link
Contributor Author

sekmiller commented May 2, 2022

This one may be the most on point:

Error: cannot call methods on tooltip prior to initialization; attempted to call method 'hide'

but any error essentially halts the method in its tracks.

So perhaps something happens in between the onload script and document ready that completes the initialization?

@sekmiller
Copy link
Contributor Author

sekmiller commented May 4, 2022

we took "defer" off the scripts that need to be present for the onloadScript to run. The featured dataverse carousel still works with the carousel.js script still deferred.

@sekmiller sekmiller removed their assignment May 4, 2022
@scolapasta scolapasta removed their assignment May 4, 2022
@kcondon kcondon self-assigned this May 4, 2022
@kcondon kcondon merged commit 5d1eb8a into develop May 4, 2022
@kcondon kcondon deleted the 8669-tooltips-broken-on-add-data branch May 4, 2022 19:58
@pdurbin pdurbin added this to the 5.11 milestone May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool Tips not working on Create Dataset, Create Dataverse

4 participants