diff --git a/commons/tool/src/webapp/WEB-INF/templates/posts.hbs b/commons/tool/src/webapp/WEB-INF/templates/posts.hbs
index 6521bb7fc459..988e79f71d20 100644
--- a/commons/tool/src/webapp/WEB-INF/templates/posts.hbs
+++ b/commons/tool/src/webapp/WEB-INF/templates/posts.hbs
@@ -1,6 +1,6 @@
diff --git a/roster2/tool/src/handlebars/members_table.handlebars b/roster2/tool/src/handlebars/members_table.handlebars
index f6431029ce8f..5617597c541b 100644
--- a/roster2/tool/src/handlebars/members_table.handlebars
+++ b/roster2/tool/src/handlebars/members_table.handlebars
@@ -12,7 +12,6 @@
{{#if ../printMode}}
print
{{/if}}
- no-popup
>
diff --git a/webcomponents/tool/src/main/frontend/js/grader/sakai-grader.js b/webcomponents/tool/src/main/frontend/js/grader/sakai-grader.js
index 3f05589eda28..38bdf68f874b 100644
--- a/webcomponents/tool/src/main/frontend/js/grader/sakai-grader.js
+++ b/webcomponents/tool/src/main/frontend/js/grader/sakai-grader.js
@@ -359,7 +359,7 @@ export class SakaiGrader extends gradableDataMixin(SakaiElement) {
-
+
diff --git a/roster2/tool/src/handlebars/members_cards.handlebars b/roster2/tool/src/handlebars/members_cards.handlebars
index 9c27f6be9e4b..a02dbadd2fe1 100644
--- a/roster2/tool/src/handlebars/members_cards.handlebars
+++ b/roster2/tool/src/handlebars/members_cards.handlebars
@@ -12,7 +12,6 @@
{{#if ../printMode}}
print
{{/if}}
- no-popup
>
diff --git a/roster2/tool/src/handlebars/members_photogrid.handlebars b/roster2/tool/src/handlebars/members_photogrid.handlebars
index 3a829f8c4846..80f9669a9c24 100644
--- a/roster2/tool/src/handlebars/members_photogrid.handlebars
+++ b/roster2/tool/src/handlebars/members_photogrid.handlebars
@@ -12,9 +12,9 @@
{{#if ../printMode}}
print
{{/if}}
- {{#unless ../viewPicture}}
- no-popup
- {{/unless}}
+ {{#if ../viewPicture}}
+ popup="on"
+ {{/if}}
>
{{tr 'post_editor_initial_text'}}
-
+
${this.submission.submittedTime || (this.submission.draft && this.submission.visible) ? html`
${this.renderSubmitter()}
diff --git a/webcomponents/tool/src/main/frontend/js/sakai-user-photo.js b/webcomponents/tool/src/main/frontend/js/sakai-user-photo.js
index 7d25d8e5bc8f..a9f2f8fee70f 100644
--- a/webcomponents/tool/src/main/frontend/js/sakai-user-photo.js
+++ b/webcomponents/tool/src/main/frontend/js/sakai-user-photo.js
@@ -10,7 +10,7 @@ import { html } from "./assets/lit-html/lit-html.js";
* @element sakai-user-photo
* @property {string} user-id - A Sakai user id
* @property {string} [classes] - Extra classes to style the content
- * @property {boolean} [no-popup] Set this if you don't want the profile popup
+ * @property {string} [popup] By default, profile popups are off. Set this to "on" if you want them
* @property {boolean} [official] Set this if you want the official Sakai photo
* @property {string} [site-id] Set this to trigger permissions checks on the photo
* @property {boolean} [print] Set this to trigger the render of a print friendly img tag
@@ -22,6 +22,7 @@ class SakaiUserPhoto extends SakaiElement {
super();
this.classes = "large-thumbnail";
+ this.popup = SakaiUserPhoto.OFF;
}
static get properties() {
@@ -29,7 +30,7 @@ class SakaiUserPhoto extends SakaiElement {
return {
userId: { attribute: "user-id", type: String },
classes: { type: String },
- noPopup: { attribute: "no-popup", type: Boolean },
+ popup: { type: String },
official: { type: Boolean },
siteId: { attribute: "site-id", type: String },
print: { type: Boolean },
@@ -45,12 +46,12 @@ class SakaiUserPhoto extends SakaiElement {
this.url = `/direct/profile/${this.userId}/image/${this.official ? "official" : "thumb"}`
+ (this.siteId && `?siteId=${this.siteId}`);
+ }
- if (!this.noPopup) {
- this.updateComplete.then(() => {
- profile.attachPopups($(`#${this.generatedId}`));
- });
- }
+ if (this.popup == SakaiUserPhoto.ON && this.generatedId) {
+ this.updateComplete.then(() => {
+ profile.attachPopups($(`#${this.generatedId}`));
+ });
}
}
@@ -75,5 +76,8 @@ class SakaiUserPhoto extends SakaiElement {
}
}
+SakaiUserPhoto.OFF = "off";
+SakaiUserPhoto.ON = "on";
+
const tagName = "sakai-user-photo";
!customElements.get(tagName) && customElements.define(tagName, SakaiUserPhoto);