Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues in target-blank.js (OSOE-576) #116

Closed
0liver opened this issue Feb 20, 2023 · 4 comments · Fixed by #117
Closed

Fix issues in target-blank.js (OSOE-576) #116

0liver opened this issue Feb 20, 2023 · 4 comments · Fixed by #117
Assignees

Comments

@0liver
Copy link
Contributor

0liver commented Feb 20, 2023

Follow-up to #104.

See comments here and below.

  1. Use DOMContentLoaded event instead of load. There's no third parameter there.
  2. Remove the setTimeout indirection from the event handler. Simply pass targetBlank as the handler.
  3. Remove superfluous configuration from package.json file:
    a. "nodejsExtensions"
    b. "devDependencies"
  4. Use compiled scripts from wwwroot\js folder instead of wwwroot\scripts here after 3.a.
  5. Reorder the conditions here.

Jira issue

@TheHydes
Copy link
Contributor

From target-blank.js the whole second part can be removed starting with "window.addEventListener...", that makes the "Use DOMContentLoaded event instead of..." part unneccesary, right?

@0liver
Copy link
Contributor Author

0liver commented Feb 20, 2023

No.

    window.addEventListener(
        'load',
        () => {
            window.setTimeout(targetBlank, 100);
        },
        false);

Should become:

    document.addEventListener('DOMContentLoaded', targetBlank);

@TheHydes
Copy link
Contributor

I see, understood.

@Piedone
Copy link
Member

Piedone commented May 12, 2024

Fixed in #117.

@Piedone Piedone closed this as completed May 12, 2024
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 a pull request may close this issue.

3 participants