Skip to content

Prevent insertion of font links in head element #636

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

Merged
merged 2 commits into from
Feb 8, 2017
Merged

Prevent insertion of font links in head element #636

merged 2 commits into from
Feb 8, 2017

Conversation

blamens
Copy link
Contributor

@blamens blamens commented Jan 31, 2017

Added check on ENV.useFontsFromAssets to prevent the insertion of links to fonts.googleapi.com in the contentFor hook

@miguelcobain
Copy link
Collaborator

I have three requests:

  1. this config flag should live under an ember-paper hash, not directly on ENV
  2. can we make the name less confusing/presumptuous? useFontsFromAssets looks like ember-paper will start using the fonts from assets, but that's not what will happen at all. I think the addon should add links when insertFontLinks is true or undefined (making it the default) and should not add links when it is false.
  3. Add an entry on the Changelog

Is this ok for you? Thanks for the PR!

@blamens
Copy link
Contributor Author

blamens commented Feb 2, 2017

  • Renamed config flag to insertFontLinks and added it to ember-paper hash in ENV
  • Used the config hook to set the default of the flag
  • Added entry to changelog

Let me know if I need to change anything else!

CHANGELOG.md Outdated
@@ -6,6 +6,7 @@ Version 1.0 introduces many API changes relative to previous releases. In additi

Contributions and pull requests are always welcome. Contributors may often be found on the [#e-paper channel on slack](https://embercommunity.slack.com/messages/e-paper/). Building the dummy application by installing `ember-paper` as if it were an application will provide you an up-to-date interactive demo, templates, and code samples.

- Consuming apps can now specify `ENV['ember-paper'].insertFontLinks` to prevent the insertion of fonts.googleapi links in the head tag
Copy link
Collaborator

Choose a reason for hiding this comment

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

The entry should be on a ### master version below.

contentFor: function(type, config) {
if (type === 'head') {
return '<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">' +
'<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">';
if (config['ember-paper'].insertFontLinks) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You still need to test if type === 'head', right?

@blamens
Copy link
Contributor Author

blamens commented Feb 3, 2017

The nested if blocks are intentional (if some other stuff needs to be done to the head element in the future).

I'm not sure I understand the changelog structure. Should the entry be placed like this? In the 1.0.0-alpha.15 (January 26, 2017) section?

@ghost
Copy link

ghost commented Feb 8, 2017

Can we add this option to the documentation as well?

Perhaps in the introduction section?
https://github.com/miguelcobain/ember-paper/blob/master/tests/dummy/app/templates/index.hbs

@miguelcobain
Copy link
Collaborator

@anthonycollini done. Will appear when the demo app is deployed again.

@miguelcobain miguelcobain dismissed their stale review February 8, 2017 17:09

i fixed the issues.

@miguelcobain miguelcobain merged commit 36d29e7 into adopted-ember-addons:master Feb 8, 2017
@v3ss0n
Copy link

v3ss0n commented Feb 9, 2017

Thanks , thats very good!

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.

3 participants