From 5466bf8e0485f135ae3df4534639bfcaf80d47e5 Mon Sep 17 00:00:00 2001 From: Melody Date: Mon, 25 May 2015 00:05:19 -0700 Subject: [PATCH] List view looks nice. Unhide functionality unkown --- scripts/CardListController.js | 20 ++++++++++++++++++++ templates/cardlist.html | 22 +++++++--------------- 2 files changed, 27 insertions(+), 15 deletions(-) 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 @@
View Feed + Show Hidden
- -
- - - - - - - - - - - - -
Name
{{card.text}}
+
+
-- 1.9.1