diff --git a/scripts/CardListController.js b/scripts/CardListController.js index cb2fcd8..f0ccdcd 100644 --- a/scripts/CardListController.js +++ b/scripts/CardListController.js @@ -13,10 +13,30 @@ angular.module('flashy.CardListController', ['ui.router']). error(function(err) { console.log('pulling feed failed'); }); + $scope.viewFeed = function() { $state.go('feed', {sectionId: sectionId}); console.log('go to feed'); }; + // unhide card (dunno if it works yet) + $scope.unhide = function(card) { + $http.post('/api/flashcards/' + card.id + '/unhide'). + success(function(data) { + console.log(card.text + " unhidden"); + }). + error(function(err) { + console.log('no unhide for you'); + }); + }; + + // toggle button text from show to hide + $(function(){ + $("#showHidden").click(function () { + $(this).text(function(i, text){ + return text === "Show Hidden" ? "Hide Hidden" : "Show Hidden"; + }) + }); + }) }]); diff --git a/templates/cardlist.html b/templates/cardlist.html index 8b03b97..025bfef 100644 --- a/templates/cardlist.html +++ b/templates/cardlist.html @@ -1,20 +1,12 @@
- -Name | -
---|
{{card.text}} | -