Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function RoomCtrl($scope, $routeParams, $timeout, socket) {
case ('tshirt'):
return tshirt;
default:
return [];
return val.split(" ");
}
};

Expand Down Expand Up @@ -344,13 +344,18 @@ function RoomCtrl($scope, $routeParams, $timeout, socket) {
};

$scope.setCardPack = function (cardPack) {
$scope.showCustom = false;
$scope.cardPack = cardPack;
$scope.resetVote();

// console.log("set card pack", { roomUrl: $scope.roomId, cardPack: cardPack });
socket.emit('set card pack', { roomUrl: $scope.roomId, cardPack: cardPack });
};

$scope.setCustomPack = function () {
$scope.showCustom = true;
}

$scope.vote = function (vote) {
if ($scope.myVote !== vote) {
if (!votingFinished() && $scope.voter) {
Expand Down Expand Up @@ -403,6 +408,7 @@ function RoomCtrl($scope, $routeParams, $timeout, socket) {
$scope.humanCount = 0;
$scope.voterCount = 0;
$scope.showAdmin = false;
$scope.showCustom = false;
$scope.voter = true;
$scope.connections = {};
$scope.votes = [];
Expand Down
20 changes: 15 additions & 5 deletions app/partials/room.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,29 @@
<li class="dropdown__item"><a href="#" ng-model="cardPack" id="deckSeq" ng-click="setCardPack('seq')">Sequential</a></li>
<li class="dropdown__item"><a href="#" ng-model="cardPack" id="deckPlay" ng-click="setCardPack('play')">Playing Cards</a></li>
<li class="dropdown__item"><a href="#" ng-model="cardPack" id="deckShirt" ng-click="setCardPack('tshirt')">T-Shirt</a></li>
<li class="dropdown__item"><a href="#" ng-model="cardPack" id="deckCustom" ng-click="setCustomPack()">Custom</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>


<div class="cards{{cardsState}}">
<div ng-show="cards" ng-repeat="card in cards" ng-click="vote(card)" class="card" ng-class="{'card--selected' : card==myVote}" cardvalue>
{{card}}
</div>
<div ng-hide="cards" class="waiting">
No cards found
<div ng-switch on="showCustom">
<div ng-switch-when="true">
<input ng-model="customPack" ui-enter="setCardPack(customPack)" name="packfield" id="packfield" type="tel" maxlength="50" placeholder="space separated values" class="roomUrl" autofocus/>
<button ng-click="setCardPack(customPack)" class="span2 btn" >Set</button>
</div>
<div ng-switch-when="false">
<div ng-show="cards" ng-repeat="card in cards" ng-click="vote(card)" class="card" ng-class="{'card--selected' : card==myVote}" cardvalue>
{{card}}
</div>
<div ng-hide="cards" class="waiting">
No cards found
</div>
</div>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"devDependencies": {
"socket.io-client": "*"
}
}
}