Browse Source

[search] Loading feedback on the search button

Romain Rigaux 10 years ago
parent
commit
fe890c8585

+ 1 - 0
apps/search/src/search/static/search/js/search.ko.js

@@ -1091,6 +1091,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
   self.search = function (callback) {
     $(".jHueNotify").hide();
     logGA('search');
+    self.isRetrievingResults(true);
 
     // Multi queries
     var multiQs = [];

+ 5 - 1
apps/search/src/search/templates/search.mako

@@ -99,7 +99,11 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
 
       <a class="btn" href="javascript:void(0)" data-bind="click: $root.query.addQ"><i class="fa fa-plus"></i></a>
 
-      <button type="submit" id="search-btn" class="btn btn-inverse" style="margin-left:10px"><i class="fa fa-search"></i></button>
+      <button type="submit" id="search-btn" class="btn btn-inverse" style="margin-left:10px">
+        <i class="fa fa-search" data-bind="visible: ! isRetrievingResults()"></i>
+        <!--[if !IE]> --><i class="fa fa-spinner fa-spin" data-bind="visible: isRetrievingResults()"></i><!-- <![endif]-->
+        <!--[if IE]><img src="${ static('desktop/art/spinner.gif') }" data-bind="visible: ! isRetrievingResults()"/><![endif]-->        
+      </button>
     </div>
   </form>
 </div>