From b21496e3fbf5ad8c4fb92c85454eef1e6c683a5e Mon Sep 17 00:00:00 2001 From: Robin Ward <robin.ward@gmail.com> Date: Wed, 25 Jun 2014 14:03:25 -0400 Subject: [PATCH] ES6: Convert search views --- .../discourse/templates/search.js.handlebars | 2 +- ...ults_type_view.js => search-results-type.js.es6} | 12 +----------- .../views/{search/search_view.js => search.js.es6} | 13 +------------ 3 files changed, 3 insertions(+), 24 deletions(-) rename app/assets/javascripts/discourse/views/{search/search_results_type_view.js => search-results-type.js.es6} (56%) rename app/assets/javascripts/discourse/views/{search/search_view.js => search.js.es6} (77%) diff --git a/app/assets/javascripts/discourse/templates/search.js.handlebars b/app/assets/javascripts/discourse/templates/search.js.handlebars index a02b2bfa1e8..641e0445cab 100644 --- a/app/assets/javascripts/discourse/templates/search.js.handlebars +++ b/app/assets/javascripts/discourse/templates/search.js.handlebars @@ -22,7 +22,7 @@ {{/if}} {{/if}} </li> - {{view Discourse.SearchResultsTypeView typeBinding="resultType.type" contentBinding="resultType.results"}} + {{view 'search-results-type' type=resultType.type content=resultType.results}} </ul> {{/each}} {{else}} diff --git a/app/assets/javascripts/discourse/views/search/search_results_type_view.js b/app/assets/javascripts/discourse/views/search-results-type.js.es6 similarity index 56% rename from app/assets/javascripts/discourse/views/search/search_results_type_view.js rename to app/assets/javascripts/discourse/views/search-results-type.js.es6 index 2c63dd328d4..b77d523c0d4 100644 --- a/app/assets/javascripts/discourse/views/search/search_results_type_view.js +++ b/app/assets/javascripts/discourse/views/search-results-type.js.es6 @@ -1,12 +1,4 @@ -/** - This view handles the rendering of search results - - @class SearchResultsTypeView - @extends Ember.CollectionView - @namespace Discourse - @module Discourse -**/ -Discourse.SearchResultsTypeView = Ember.CollectionView.extend({ +export default Ember.CollectionView.extend({ tagName: 'ul', itemViewClass: Discourse.GroupedView.extend({ tagName: 'li', @@ -15,5 +7,3 @@ Discourse.SearchResultsTypeView = Ember.CollectionView.extend({ selected: Discourse.computed.propertyEqual('content.index', 'controller.selectedIndex') }) }); - - diff --git a/app/assets/javascripts/discourse/views/search/search_view.js b/app/assets/javascripts/discourse/views/search.js.es6 similarity index 77% rename from app/assets/javascripts/discourse/views/search/search_view.js rename to app/assets/javascripts/discourse/views/search.js.es6 index c51bb699102..261c6563047 100644 --- a/app/assets/javascripts/discourse/views/search/search_view.js +++ b/app/assets/javascripts/discourse/views/search.js.es6 @@ -1,12 +1,4 @@ -/** - This view handles search facilities of Discourse - - @class SearchView - @extends Discourse.View - @namespace Discourse - @module Discourse -**/ -Discourse.SearchView = Discourse.View.extend({ +export default Discourse.View.extend({ tagName: 'div', classNames: ['d-dropdown'], elementId: 'search-dropdown', @@ -34,7 +26,4 @@ Discourse.SearchView = Discourse.View.extend({ } }); } - }); - -