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

Call DOM altering functions after snippet finishes initializing. #123

Merged
merged 2 commits into from
Sep 8, 2015

Conversation

glogiotatidis
Copy link
Contributor

No description provided.

// Add sample rate and snippet ID to currently displayed links.
var parameters = ('sample_rate=' + SNIPPET_METRICS_SAMPLE_RATE + '&snippet_name=' +
show_snippet_id);
modifyLinks(topSection.getElementsByTagName('a'), parameters);

Choose a reason for hiding this comment

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

seeing we know we will always be in Fx only, I would do:

...(topSection.querySelectorAll('a'),....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is querySelectorAll a Fx only feature? Is this faster?

Choose a reason for hiding this comment

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

No, not Fx only, all modern browsers support it and yes, unless you are doing getElementById it is faster.

@glogiotatidis
Copy link
Contributor Author

@schalkneethling do you have any other comments on this? Reading your comments on mozmeao/snippets#53 if you can use the close button on the logo it means that this works as expected for you.

@schalkneethling
Copy link

r+ 🀄

@schalkneethling
Copy link

I do not have big green button access so, merge at will.

@glogiotatidis
Copy link
Contributor Author

Thanks!

glogiotatidis added a commit that referenced this pull request Sep 8, 2015
Call DOM altering functions after snippet finishes initializing.
@glogiotatidis glogiotatidis merged commit e9c3871 into mozmeao:master Sep 8, 2015
@glogiotatidis glogiotatidis deleted the alter-after-init branch December 2, 2015 10:35
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.

None yet

2 participants