From d6a733440eee34dab3daf25089d40aed91018a49 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 4 Apr 2013 12:04:34 +0200 Subject: Limit the amount of displayed phone_numbers in a switchboard_entry --- public/js/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/js/app.js b/public/js/app.js index 4bc8cc1..3124f41 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -71,7 +71,13 @@ App.SipAccount = DS.Model.extend({ switchboardEntrys: DS.hasMany('App.SwitchboardEntry'), phoneNumbers: DS.hasMany('App.PhoneNumber'), callerName: DS.attr('string'), - authName: DS.attr('string') + authName: DS.attr('string'), + + phoneNumberShortList: Ember.computed(function() { + var phoneNumbers = this.get('phoneNumbers'); + return phoneNumbers.slice(0,amount_of_displayed_phone_numbers); + }).property('phoneNumbers.@each.number') + }); App.PhoneNumber = DS.Model.extend({ -- cgit v1.2.3