ember-cli-document-title
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -0,1 +1,6 @@ | ||
## 0.1.0 | ||
+ Removed another use of prototype extensions [#12](https://github.com/kimroen/ember-cli-document-title/pull/12) | ||
+ Made sure use with Fastboot doesn't explode [#13](https://github.com/kimroen/ember-cli-document-title/pull/13) | ||
+ Added testing of more Ember versions (1.10 and up)[#13](https://github.com/kimroen/ember-cli-document-title/pull/13) | ||
## 0.0.3 | ||
@@ -2,0 +7,0 @@ + Re-did the addon structure to match newer addon conventions [#3](https://github.com/kimroen/ember-cli-document-title/pull/3) |
{ | ||
"name": "ember-cli-document-title", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "Adding document title functionality to your ember app", | ||
@@ -30,4 +30,4 @@ "main": "index.js", | ||
"ember-cli": "0.2.0-beta.1", | ||
"ember-cli-app-version": "0.3.1", | ||
"ember-cli-babel": "^4.0.0", | ||
"ember-cli-app-version": "0.3.1", | ||
"ember-cli-content-security-policy": "0.3.0", | ||
@@ -42,2 +42,3 @@ "ember-cli-dependency-checker": "0.0.7", | ||
"ember-export-application-global": "^1.0.2", | ||
"ember-try": "0.0.5", | ||
"express": "^4.8.5", | ||
@@ -44,0 +45,0 @@ "glob": "^4.0.5" |
# Sane Document Title [![Build Status](https://travis-ci.org/kimroen/ember-cli-document-title.svg?branch=master)](https://travis-ci.org/kimroen/ember-cli-document-title) | ||
This addon adds sane `document.title` integration to your ember app. | ||
All it does is include [this gist by @machty](https://gist.github.com/machty/8413411) to your application. | ||
Originally based on [this gist by @machty](https://gist.github.com/machty/8413411), and since improved upon by many fabulous contributors. | ||
Tested to work with Ember 1.10 and up. | ||
## Install | ||
Install by running | ||
``` | ||
ember install:addon ember-cli-document-title | ||
ember install ember-cli-document-title | ||
``` | ||
@@ -40,3 +43,3 @@ | ||
export default Ember.Route.extend({ | ||
title: "Our Favorite posts!" | ||
title: 'Our Favorite posts!' | ||
}); | ||
@@ -46,3 +49,3 @@ | ||
export default Ember.Route.extend({ | ||
title: "Please enjoy this post" | ||
title: 'Please enjoy this post' | ||
}); | ||
@@ -58,3 +61,3 @@ ``` | ||
export default Ember.Route.extend({ | ||
titleToken: "Posts" | ||
titleToken: 'Posts' | ||
}); | ||
@@ -81,3 +84,3 @@ ``` | ||
Ember.Object.create({ | ||
name: "Ember is Omakase" | ||
name: 'Ember is Omakase' | ||
}); | ||
@@ -101,3 +104,3 @@ ``` | ||
export default Ember.Route.extend({ | ||
titleToken: "Posts" | ||
titleToken: 'Posts' | ||
}); | ||
@@ -112,3 +115,6 @@ ``` | ||
title: function(tokens) { | ||
return tokens.reverse().join(' - ') + ' - My Blog'; | ||
var base = 'My Blog'; | ||
var hasTokens = tokens && tokens.length; | ||
return hasTokens ? tokens.reverse().join(' - ') + ' - ' + base : base; | ||
} | ||
@@ -115,0 +121,0 @@ }); |
@@ -57,13 +57,15 @@ var get = Ember.get; | ||
Ember.Router.reopen({ | ||
updateTitle: function() { | ||
updateTitle: Ember.on('didTransition', function() { | ||
this.send('collectTitleTokens', []); | ||
}.on('didTransition'), | ||
}), | ||
setTitle: function(title) { | ||
if (Ember.testing) { | ||
this._title = title; | ||
var renderer = this.container.lookup('renderer:-dom'); | ||
if (renderer) { | ||
Ember.set(renderer, '_dom.document.title', title); | ||
} else { | ||
window.document.title = title; | ||
document.title = title; | ||
} | ||
} | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8481290
26
68198
121
0
16