From eea3884e14d367fd71ca403ff44a97014ab02f9f Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Wed, 9 Jul 2014 02:46:47 +0530 Subject: [PATCH] FIX: selectively disappear invite search box --- .../javascripts/discourse/controllers/user-invited.js.es6 | 5 +++-- .../javascripts/discourse/routes/user_invited_route.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/user-invited.js.es6 b/app/assets/javascripts/discourse/controllers/user-invited.js.es6 index edab11689fc..4f39b903a35 100644 --- a/app/assets/javascripts/discourse/controllers/user-invited.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-invited.js.es6 @@ -12,6 +12,7 @@ export default Ember.ObjectController.extend({ init: function() { this._super(); this.set('searchTerm', ''); + this.set('totalInvites', ''); }, uploadText: function() { return I18n.t("user.invited.bulk_invite.text"); }.property(), @@ -59,8 +60,8 @@ export default Ember.ObjectController.extend({ @property showSearch **/ showSearch: function() { - return this.get('invites.length') > 9; - }.property(), + return this.get('totalInvites') > 9; + }.property('totalInvites'), /** Were the results limited by our `maxInvites` diff --git a/app/assets/javascripts/discourse/routes/user_invited_route.js b/app/assets/javascripts/discourse/routes/user_invited_route.js index 797f4e5a0e6..aaa1a152a6b 100644 --- a/app/assets/javascripts/discourse/routes/user_invited_route.js +++ b/app/assets/javascripts/discourse/routes/user_invited_route.js @@ -19,7 +19,8 @@ Discourse.UserInvitedRoute = Discourse.Route.extend({ controller.setProperties({ model: model, user: this.controllerFor('user').get('model'), - searchTerm: '' + searchTerm: '', + totalInvites: model.invites.length }); this.controllerFor('user').set('indexStream', false); },