Skip to content

Commit

Permalink
SAK-32336 Honour official photo when printing (sakaiproject#4098)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish authored Mar 16, 2017
1 parent 0f6e1ff commit 16be7eb
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions roster2/src/webapp/js/roster.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@
button.prop('disabled', true);

e.preventDefault();
roster.renderMembership({renderAll: true, callback: function () {
roster.renderMembership({
renderAll: true,
forceOfficialPicture: roster.officialPictureMode,
callback: function () {

$('#roster-members').waitForImages(function () {

button.prop('disabled', false);
window.print();
});
}});
}
});
});
};

Expand Down Expand Up @@ -118,7 +122,7 @@

var showOfficialPictures = false;

if ((arg && arg.forceOfficialPicture) || roster.rosterOfficialPictureMode) {
if ((arg && arg.forceOfficialPicture) || roster.officialPictureMode) {
showOfficialPictures = true;
}

Expand Down Expand Up @@ -161,13 +165,13 @@

$('#roster_official_picture_button').click(function (e) {

roster.rosterOfficialPictureMode = true;
roster.officialPictureMode = true;
roster.renderMembership({ forceOfficialPicture: true, replace: true });
});

$('#roster_profile_picture_button').click(function (e) {

roster.rosterOfficialPictureMode = false;
roster.officialPictureMode = false;
roster.renderMembership({ forceOfficialPicture: false, replace: true });
});
}
Expand Down Expand Up @@ -207,7 +211,7 @@

var showOfficialPictures = false;

if ((arg && arg.forceOfficialPicture) || roster.rosterOfficialPictureMode) {
if ((arg && arg.forceOfficialPicture) || roster.officialPictureMode) {
showOfficialPictures = true;
}

Expand Down Expand Up @@ -239,13 +243,13 @@

$('#roster_official_picture_button').click(function (e) {

roster.rosterOfficialPictureMode = true;
roster.officialPictureMode = true;
roster.renderMembership({ forceOfficialPicture: true, replace: true });
});

$('#roster_profile_picture_button').click(function (e) {

roster.rosterOfficialPictureMode = false;
roster.officialPictureMode = false;
roster.renderMembership({ forceOfficialPicture: false, replace: true });
});
}
Expand Down Expand Up @@ -528,7 +532,7 @@
}

if (userIds.length > 0) {
roster.renderMembership({ showOfficialPictures: roster.rosterOfficialPictureMode,
roster.renderMembership({ showOfficialPictures: roster.officialPictureMode,
replace: true,
userIds: userIds });
} else {
Expand Down Expand Up @@ -715,11 +719,11 @@
roster.enrollmentSetToView = null;
roster.enrollmentSetToViewText = null;
roster.enrollmentStatusToViewText = roster.i18n.roster_enrollment_status_all;
roster.rosterOfficialPictureMode = false;
roster.officialPictureMode = false;
roster.nextPage = 0;
roster.currentState = null;

roster.rosterOfficialPictureMode = roster.officialPicturesByDefault;
roster.officialPictureMode = roster.officialPicturesByDefault;

// We need the toolbar in a template so we can swap in the translations
roster.render('navbar', {}, 'roster_navbar');
Expand Down

0 comments on commit 16be7eb

Please sign in to comment.