From 150dd0d712ae0c2f0854331200027339b5820175 Mon Sep 17 00:00:00 2001 From: Wojciech Zawistowski Date: Mon, 27 Jan 2014 17:45:30 +0100 Subject: [PATCH] Refactors Discourse.SearchController to use var self = this; convention --- .../discourse/controllers/search_controller.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/search_controller.js b/app/assets/javascripts/discourse/controllers/search_controller.js index 985244c6211..c195a2e9272 100644 --- a/app/assets/javascripts/discourse/controllers/search_controller.js +++ b/app/assets/javascripts/discourse/controllers/search_controller.js @@ -23,18 +23,18 @@ Discourse.SearchController = Em.ArrayController.extend(Discourse.Presence, { }.observes('term', 'typeFilter'), searchTerm: Discourse.debouncePromise(function(term, typeFilter) { - var searchController = this; - this.set('resultCount', 0); + var self = this; + self.set('resultCount', 0); var searcher = Discourse.Search.forTerm(term, { typeFilter: typeFilter, - searchContext: searchController.get('searchContext') + searchContext: self.get('searchContext') }); return searcher.then(function(results) { - searchController.set('results', results); + self.set('results', results); if (results) { - searchController.set('noResults', results.length === 0); + self.set('noResults', results.length === 0); var index = 0; results = _(['topic', 'category', 'user']) @@ -49,11 +49,11 @@ Discourse.SearchController = Em.ArrayController.extend(Discourse.Presence, { }) .value(); - searchController.set('resultCount', index); - searchController.set('content', results); + self.set('resultCount', index); + self.set('content', results); } - searchController.set('loading', false); + self.set('loading', false); }); }, 300),