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

docblock "Mantis Graph plugin" und get rid of jquery #3

Open
grummbeer opened this issue Jul 22, 2022 · 2 comments
Open

docblock "Mantis Graph plugin" und get rid of jquery #3

grummbeer opened this issue Jul 22, 2022 · 2 comments

Comments

@grummbeer
Copy link

Thanks for your plugin, works fine, but one little thing … :-)

/**
 * Mantis Graph plugin
 */

Wouldn't it be nice to get rid of jquery?

document.addEventListener('DOMContentLoaded', function(event) {[
    '#buglist .fa-status-box' /*listing*/,
    '#view-issue-page .fa-status-box' /*view header/relations*/
  ].forEach((selector) => {
    document.querySelectorAll(selector).forEach((status) => {
      status.closest('td').classList.add([...status.classList].find((n) => /^status-/.test(n))?.replace('-fg','-bg'));
      status.remove()
    })
  })
});

I know jquery is there anyway and so why not use it. But it's about jquery itself and vanilla looks nicer … and the bug relations would also colored -:)

@wiz78
Copy link
Owner

wiz78 commented Jul 22, 2022

I don't usually like jQuery, but it's what mantis uses and it saved me some keystrokes :-)

@grummbeer
Copy link
Author

Yeah, of course. It's just a suggestion to modernize the plugin to make it look more like 2022.

I already counted the keystrokes jquery: 798 vs. vanilla: 295. +1 for modern :-P

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

No branches or pull requests

2 participants