Skip to content

Commit

Permalink
Correction on the Honorary Member
Browse files Browse the repository at this point in the history
Filter changes were not added to the Honorary part
Better scroll on the Honorary Members list
  • Loading branch information
Gulix committed Mar 7, 2017
1 parent 6e2aaa7 commit eeb1a80
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
4 changes: 3 additions & 1 deletion builder/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ h3 {
.roster-supreme {
width: 189px;
height: 150px;
margin: 10px;
margin: 8px;
-webkit-border-radius: 10px 10px 0 0;
border-radius: 10px 10px 0 0;
border-style: solid;
Expand Down Expand Up @@ -534,6 +534,8 @@ h3 {

.modal-frame-large {
overflow-y: scroll;
height: 100%;
width: 100%;
}

.modal-label {
Expand Down
7 changes: 2 additions & 5 deletions builder/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,11 @@ <h2>Recruit your Supremes</h2>
</div>
<!-- ko if: isHonoraryMembersSelectable -->
<div class="modal-box">
<div class="modal-content">
<div class="modal-content" id="honorary-member-selection-box">
<div class="icon-close modal-close" data-bind="click: endHonoraryMemberSelection"></div>
<div class="modal-frame modal-frame-large">
<div class="modal-label">Select your Honorary Member</div>
<div data-bind="with: $parent.supremeFilter">
<select data-bind="options: origins, optionsText: 'origin_label', value: selectedOrigin,"></select>
<select data-bind="options: roles, optionsText: 'role_label', value: selectedRole,"></select>
</div>
<supremes-filter params="filter: $parent.supremeFilter"></supremes-filter>
<div class="recruitment-list scrollable-list" data-bind="foreach: possibleHonoraryMembers">
<supreme-box params="supreme: $data"></supreme-box>
</div>
Expand Down
1 change: 1 addition & 0 deletions builder/js/viewmodels/teamBuilderVM.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function teamBuilderVM()
self.loadTeamForAffiliation = function(affiliationVM) {
self.affiliations([]);
self.team(TeamVM.newTeamVM(affiliationVM));
self.team().setBuilder(self);
self.supremesPool(SupremeVM.loadForAffiliation(affiliationVM, self.recruitSupreme, self.dismissSupreme));
}

Expand Down
21 changes: 18 additions & 3 deletions builder/js/viewmodels/teamVM.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
define(['knockout',
define(['jQuery',
'knockout',
'lodash',
'viewmodels/supremeVM',
'scripts/teamCode',
'scripts/url'
],
function(ko,
function($,
ko,
_,
SupremeVM,
TeamCode,
Expand All @@ -31,6 +33,8 @@ function teamVM(affiliation)
// Honorary Members
self.isHonoraryMembersSelectable = ko.observable(false);
self.supremeGrantingHonorary = ko.observable(null);
// TeamBuilder
self.teamBuilderVM = null;

/**********************************/
/* Accessors & Computed Variables */
Expand Down Expand Up @@ -116,7 +120,10 @@ function teamVM(affiliation)
}

// User Filter
//supremes = self.supremeFilter().filter(supremes);
if (self.teamBuilderVM != null) {
supremes = self.teamBuilderVM.supremeFilter().filter(supremes);
}


return _.sortBy(supremes, [function(o) { return o.jsonData.name; }]);
})
Expand Down Expand Up @@ -232,6 +239,10 @@ function teamVM(affiliation)
/* Honorary Member */
self.chooseHonoraryMember = function(supremeVM) {
self.isHonoraryMembersSelectable(true);
// Height of the box
var viewportHeight = $(window).height();
$('#honorary-member-selection-box').css('height', viewportHeight * 0.8);

self.supremeGrantingHonorary(supremeVM);
}
self.endHonoraryMemberSelection = function() {
Expand Down Expand Up @@ -261,6 +272,10 @@ function teamVM(affiliation)
self.dismissSupreme(supremeVM);
}

self.setBuilder = function(teamBuilderVM) {
self.teamBuilderVM = teamBuilderVM;
}

/*************************/
/* Object Initialization */
/*************************/
Expand Down

0 comments on commit eeb1a80

Please sign in to comment.