From 2e4e6225a11334c4a77fb8adb0fa0089db13ef4a Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 16 Oct 2012 13:04:29 +0200 Subject: [PATCH] Improved displayName(). --- app/assets/javascripts/app/index.js.coffee | 1 + app/assets/javascripts/app/models/application_model.js.coffee | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/index.js.coffee b/app/assets/javascripts/app/index.js.coffee index 52e10e1d9..665d181fc 100644 --- a/app/assets/javascripts/app/index.js.coffee +++ b/app/assets/javascripts/app/index.js.coffee @@ -40,6 +40,7 @@ class App extends Spine.Controller # define print name helper params.P = ( item ) -> + return item if !item if typeof item is 'object' if item.displayNameLong item.displayNameLong() diff --git a/app/assets/javascripts/app/models/application_model.js.coffee b/app/assets/javascripts/app/models/application_model.js.coffee index 0f0e3e15e..f91174c57 100644 --- a/app/assets/javascripts/app/models/application_model.js.coffee +++ b/app/assets/javascripts/app/models/application_model.js.coffee @@ -9,7 +9,7 @@ class App.Model extends Spine.Model if @lastname if name name = name + ' ' - name = name + @lastname + name = name + @lastname return name return '???' @@ -20,7 +20,7 @@ class App.Model extends Spine.Model if @lastname if name name = name + ' ' - name = name + @lastname + name = name + @lastname if @organization if typeof @organization is 'object' name = "#{name} (#{@organization.name})"