From f9c7de425b9deb29e4ea1816683c2be949294574 Mon Sep 17 00:00:00 2001 From: jdat82 Date: Sat, 14 May 2016 12:55:59 +0200 Subject: [PATCH] =?UTF-8?q?feature/character-list=20=E2=80=94=20very=20lig?= =?UTF-8?q?ht=20refactoring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/character/list/character-list.controller.js | 10 +++++----- app/character/list/character-list.jade | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/character/list/character-list.controller.js b/app/character/list/character-list.controller.js index 75cb422..cec848c 100644 --- a/app/character/list/character-list.controller.js +++ b/app/character/list/character-list.controller.js @@ -15,10 +15,10 @@ vm.characters = []; vm.searching = false; vm.offset = 0; - vm.hasMoreData = false; + vm.hasMore = false; vm.toggleFave = toggleFave; vm.search = search; - vm.loadMore = loadMore; + vm.showMore = showMore; var listeners = []; var faves = favouriteService.faves; @@ -39,7 +39,7 @@ showSpinner(); var promise = characterService.findByName(vm.filter); vm.characters = []; - vm.hasMoreData = false; + vm.hasMore = false; vm.offset = 0; $cordovaKeyboard.close(); return promise @@ -63,7 +63,7 @@ vm.searching = false; } - function loadMore() { + function showMore() { showSpinner(); vm.offset += defaultOffset; return characterService.findByName(vm.filter, vm.offset) @@ -81,7 +81,7 @@ // Update meta meta = vm.characters.meta = results.meta; // Update boolean to know instantly if there is more - vm.hasMoreData = meta && (meta.count + meta.offset) < meta.total; + vm.hasMore = meta && (meta.count + meta.offset) < meta.total; } // Event handler called when clicking the fave button (heart). diff --git a/app/character/list/character-list.jade b/app/character/list/character-list.jade index 4ec94a8..a1cf5b1 100644 --- a/app/character/list/character-list.jade +++ b/app/character/list/character-list.jade @@ -17,5 +17,5 @@ ion-view.characters(view-title='Characters') | {{::character.name}} .characters__footer ion-spinner(ng-if='vm.searching') - button.button.button-block.button-assertive.characters__show-more(ng-click='vm.loadMore()' ng-show='vm.hasMoreData') + button.button.button-block.button-assertive.characters__show-more(ng-click='vm.showMore()' ng-show='vm.hasMore') | Show more