Rename root variable

This commit is contained in:
William Tisäter 2014-05-04 23:07:41 +02:00
parent 227daf1fea
commit 3852bef667
1 changed files with 5 additions and 5 deletions

View File

@ -2,11 +2,11 @@
// Superclass to be used by all of the main routes below.
//
App.BaseRoute = Ember.Route.extend({
rootRoute: '',
rootKey: '',
getParentAndGrandparent: function(key) {
var parentKey = this.rootRoute,
grandParentKey = this.rootRoute,
var parentKey = this.rootKey,
grandParentKey = this.rootKey,
parts = key.split('/');
if (parts.length > 0) {
@ -38,7 +38,7 @@ App.BaseRoute = Ember.Route.extend({
// Used to link to keys that are not objects,
// like parents and grandParents
linkToKey: function(key) {
if (key.slice(-1) === '/' || key === this.rootRoute) {
if (key.slice(-1) === '/' || key === this.rootKey) {
this.transitionTo('kv.show', key)
} else {
this.transitionTo('kv.edit', key)
@ -100,7 +100,7 @@ App.DcRoute = App.BaseRoute.extend({
App.KvIndexRoute = App.BaseRoute.extend({
beforeModel: function() {
this.transitionTo('kv.show', this.rootRoute)
this.transitionTo('kv.show', this.rootKey)
}
});