aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/display.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display/display.js')
-rw-r--r--ext/js/display/display.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js
index aad54e1c..600df954 100644
--- a/ext/js/display/display.js
+++ b/ext/js/display/display.js
@@ -231,10 +231,6 @@ class Display extends EventDispatcher {
return this._parentPopupId;
}
- get notificationContainer() {
- return this._footerNotificationContainer;
- }
-
get selectedIndex() {
return this._index;
}
@@ -512,6 +508,19 @@ class Display extends EventDispatcher {
return Number.isFinite(index) ? index : -1;
}
+ /**
+ * Creates a new notification.
+ * @param {boolean} scannable Whether or not the notification should permit its content to be scanned.
+ * @returns {DisplayNotification} A new notification instance.
+ */
+ createNotification(scannable) {
+ const node = this._displayGenerator.createEmptyFooterNotification();
+ if (scannable) {
+ node.classList.add('click-scannable');
+ }
+ return new DisplayNotification(this._footerNotificationContainer, node);
+ }
+
// Message handlers
_onDirectMessage(data) {
@@ -857,9 +866,7 @@ class Display extends EventDispatcher {
if (tagNode === null) { return; }
if (this._tagNotification === null) {
- const node = this._displayGenerator.createEmptyFooterNotification();
- node.classList.add('click-scannable');
- this._tagNotification = new DisplayNotification(this._footerNotificationContainer, node);
+ this._tagNotification = this.createNotification(true);
}
const index = this.getElementDictionaryEntryIndex(tagNode);