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

Remove jquery usage to highlight sql lab menu #5907

Merged
merged 2 commits into from
Sep 17, 2018

Conversation

kristw
Copy link
Contributor

@kristw kristw commented Sep 15, 2018

Remove jquery usage to highlight sql lab menu

@graceguo-supercat

// Highlight the navbar menu
const menus = document.querySelectorAll('.nav.navbar-nav li.dropdown');
const sqlLabMenu = Array.prototype.slice.apply(menus)
.filter(element => element.innerText.trim() === 'SQL Lab')[0];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[].filter(cb)[0] is equivalent to [].find(cb)?
also if your filter function returns [], get its [0] will make trouble.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Will update.

Copy link

@graceguo-supercat graceguo-supercat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@graceguo-supercat graceguo-supercat merged commit 39ef77a into apache:master Sep 17, 2018
@kristw kristw deleted the kristw-sqllab-jquery branch September 18, 2018 01:00
kristw added a commit to kristw/incubator-superset that referenced this pull request Sep 18, 2018
* Remove jquery hack

* change filter to find

(cherry picked from commit 39ef77a)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Oct 12, 2018
* Remove jquery hack

* change filter to find
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants