Skip to content

Conversation

harrinsonmb
Copy link
Contributor

@harrinsonmb harrinsonmb commented Dec 14, 2023

Description

The main objective of this commit is to avoid problems when executing the code, when the DOM takes much longer to load than the javascript itself. Because when the DOM takes too long to load and the javascript is executed, the highlight and share modal/tooltip does not work, since when using document.querySelector("#has-highlight-and-share") it is not present in the document yet.

This commit further organizes the js code to improve readability and maintainability. Key changes include encapsulating the functionality in separate functions and adding additional comments for clarity. This makes the code easier to navigate and understand, improving maintainability and facilitating possible future changes.

Type of PR

  • Bug fix
  • Feature
  • Security fix
  • Other (please describe)

Where is the Bug? (please remove if not relevant)

  • Click to Share Block
  • Admin settings
  • Inline highlighting
  • Highlighting Text
  • Social Sharing

How Has This Been Tested (please remove if not relevant)?

Select any that are applicable

  • Browser tests
  • Performance tests
  • Local testing

Checklist

Please select all that are applicable.

  • I have set development as the base branch.
  • I have added appropriate labels to the PR.
  • I have referenced the base issue to address.
  • I have secured the code by sanitizing and escaping all inputs and outputs
  • I have cached any expensive queries
  • I have added any screenshots or videos related to the PR.

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.

1 participant