From b8ecb490c6f4df147a621eb69bf8ab4d0d4a724a Mon Sep 17 00:00:00 2001 From: Alex Houchens Date: Mon, 4 May 2015 10:43:17 -0700 Subject: [PATCH] Allow for consuming app to define header appName --- addon/components/bf-header.js | 18 +++++++++++++++++- addon/templates/components/bf-header.hbs | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/addon/components/bf-header.js b/addon/components/bf-header.js index 0bbfe88..0ebe405 100644 --- a/addon/components/bf-header.js +++ b/addon/components/bf-header.js @@ -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') }); diff --git a/addon/templates/components/bf-header.hbs b/addon/templates/components/bf-header.hbs index 4cf47f3..5fc3191 100644 --- a/addon/templates/components/bf-header.hbs +++ b/addon/templates/components/bf-header.hbs @@ -2,7 +2,7 @@