Commit a73c4ef5f9717349152fd457bc10487c70d10c0f
1 parent
40d5b50c
Exists in
master
and in
8 other branches
Fix: item 1.4 (email)
Showing
2 changed files
with
15 additions
and
2 deletions
Show diff stats
src/app/pages/inicio/inicio.controller.js
| ... | ... | @@ -161,7 +161,18 @@ |
| 161 | 161 | }; |
| 162 | 162 | |
| 163 | 163 | InicioPageController.prototype.submitSearch = function() { |
| 164 | - vm.$log.warn('No implemented yet.'); | |
| 164 | + var vm = this; | |
| 165 | + | |
| 166 | + vm.loadingFilter = true; | |
| 167 | + | |
| 168 | + // scroll to result grid | |
| 169 | + var $searchResult = angular.element('#search-result'); | |
| 170 | + if($searchResult && $searchResult.length > 0){ | |
| 171 | + angular.element('body').animate({scrollTop: $searchResult.offset().top}, 'fast'); | |
| 172 | + vm.filtredPrograms = vm.getFiltredPrograms(); | |
| 173 | + }else{ | |
| 174 | + vm.$log.warn('#search-result element not found.'); | |
| 175 | + } | |
| 165 | 176 | }; |
| 166 | 177 | |
| 167 | 178 | InicioPageController.prototype.filter = function() { |
| ... | ... | @@ -222,6 +233,7 @@ |
| 222 | 233 | var selectedTheme = vm.selectedTheme; |
| 223 | 234 | |
| 224 | 235 | var filter = vm.$filter('filter'); |
| 236 | + vm.loadingFilter = true; | |
| 225 | 237 | |
| 226 | 238 | if (selectedTheme) { |
| 227 | 239 | output = vm._filterByCategory(output, selectedTheme); |
| ... | ... | @@ -235,6 +247,7 @@ |
| 235 | 247 | output = _balanceByCategory(output); |
| 236 | 248 | } |
| 237 | 249 | |
| 250 | + vm.loadingFilter = false; | |
| 238 | 251 | return output; |
| 239 | 252 | }; |
| 240 | 253 | ... | ... |
src/app/pages/inicio/inicio.html