Commit eaa6cd5422039ce6634dc497bb52956acb2b733e
Exists in
master
and in
1 other branch
Merge branch 'master' of https://git.ucsd.edu/110swag/flashy-frontend
Showing 4 changed files Side-by-side Diff
scripts/CardGridController.js
View file @
eaa6cd5
1 | 1 | angular.module('flashy.CardGridController', ['ui.router', 'ngAnimate', 'ngWebSocket']).CardGridController = |
2 | - function($scope, $rootScope, $state, $http, $window, $timeout, $stateParams, $websocket, UserService, Flashcard) { | |
3 | - $scope.cards = []; | |
2 | + function($scope, $rootScope, $state, $http, $window, $timeout, $stateParams, $websocket, $interval, UserService, Flashcard) { | |
3 | + $scope.cards = []; // all cards | |
4 | 4 | $scope.deck = []; |
5 | 5 | $scope.cardCols = []; // organized data |
6 | + $scope.cardColsShow = []; // displayed data | |
6 | 7 | $scope.numCols = 0; |
7 | - $scope.cardTable = {}; // look up table of cards, {'colNum':col, 'obj':card} | |
8 | + $scope.cardTable = {}; // look up table of cards: {'colNum':col, 'obj':card} | |
8 | 9 | $scope.sectionId = parseInt($stateParams.sectionId); |
9 | 10 | $scope.section = $rootScope.SectionResource.get({sectionId: $scope.sectionId}); |
10 | 11 | $scope.showGrid = false; |
11 | - $scope.moveQueue = []; | |
12 | + //$scope.moveQueue = []; // queue of flashcard objects | |
12 | 13 | $rootScope.currentSection = $scope.section; |
13 | 14 | |
14 | 15 | if (!UserService.isInSection($scope.sectionId)) { |
scripts/FeedController.js
View file @
eaa6cd5
1 | 1 | angular.module('flashy.FeedController', ['ui.router', 'ngAnimate', 'ngWebSocket', 'contenteditable']).controller('FeedController', |
2 | - function($scope, $rootScope, $state, $http, $window, $timeout, $stateParams, $websocket, UserService, Flashcard) { | |
2 | + function($scope, $rootScope, $state, $http, $window, $timeout, $stateParams, $websocket, $interval, UserService, Flashcard) { | |
3 | 3 | angular.module('flashy.CardGridController').CardGridController.apply(this, arguments); |
4 | 4 | |
5 | - $scope.sortAdd = function(card, array) { | |
6 | - console.log('sort add'); | |
7 | - array.forEach(function(ele, i, ary) { | |
8 | - if (ele.score <= card.score) { | |
9 | - ary.splice(i, 0, card); | |
10 | - return; | |
11 | - } | |
12 | - }); | |
13 | - }; | |
5 | + (function drawCols() { | |
6 | + $interval(function() { | |
7 | + if ($scope.cardColsShow != $scope.cardCols) { | |
8 | + $scope.cardColsShow = $scope.cardCols; | |
9 | + console.log('interval'); | |
10 | + } | |
11 | + }, 1000); | |
12 | + }()); | |
14 | 13 | |
15 | 14 | $scope.updateCardScore = function(card) { |
16 | 15 | console.log($scope.cardCols, card); |
service-worker.js
View file @
eaa6cd5
styles/flashy.css
View file @
eaa6cd5
... | ... | @@ -372,6 +372,20 @@ |
372 | 372 | margin-bottom: -230px; |
373 | 373 | } |
374 | 374 | |
375 | +.repeated-card.ng-move > flashcard > .card { | |
376 | + background-color:blue; | |
377 | + top: -250px; | |
378 | +} | |
379 | + | |
380 | +.repeated-card.ng-move-active > flashcard > .card { | |
381 | + top: 0 | |
382 | +} | |
383 | + | |
384 | +.repeated-card.ng-move > flashcard > .card + div { | |
385 | + background-color:red; | |
386 | + top: -250px; | |
387 | +} | |
388 | + | |
375 | 389 | /* Animation CSS END */ |
376 | 390 | |
377 | 391 | .container, .push { |