Skip to content

Commit

Permalink
Allow for consuming app to define header appName
Browse files Browse the repository at this point in the history
  • Loading branch information
ahouchens committed May 4, 2015
1 parent e2063f4 commit b8ecb49
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion addon/components/bf-header.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
/**
* @property appName is a computed property that first checks the consuming app config/environment.js
* for APP.bonfire.title
* APP: {
* bonfire: {
* title: 'Your App Name'
* }
* }
* If this is not provided then it will fetch from application.namespace.name
*/

import Ember from 'ember';
import layout from '../templates/components/bf-header';

export default Ember.Component.extend({
layout: layout,
appName: function() {
return Ember.String.capitalize(this.get('application.namespace.name'));
var configTitle = this.container.lookupFactory('config:environment').APP.bonfire.title;
if (Ember.isEmpty(configTitle)) {
return Ember.String.capitalize(this.get('application.namespace.name'));
} else {
return configTitle;
}
}.property('application.namespace.name')
});
2 changes: 1 addition & 1 deletion addon/templates/components/bf-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<nav class="navbar navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
{{#link-to "index" class="navbar-brand"}}{{appName}}{{/link-to}}
{{#link-to "index" class="navbar-brand"}} {{appName}} {{/link-to}}
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<i class="fa fa-bars"></i>
</button>
Expand Down

0 comments on commit b8ecb49

Please sign in to comment.