@internetarchive/ia-book-actions 0.1.11-b7 → 0.1.11-b9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/demo/index.html CHANGED
@@ -356,5 +356,6 @@
356
356
  </table>
357
357
  </fieldset>
358
358
  </div>
359
+ <modal-manager></modal-manager>
359
360
  </body>
360
361
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-book-actions",
3
- "version": "0.1.11-b7",
3
+ "version": "0.1.11-b9",
4
4
  "description": "Bookreader actions for borrowable book",
5
5
  "author": "Internet Archive",
6
6
  "license": "AGPL-3.0-only",
@@ -77,7 +77,6 @@ export default class IABookActions extends LitElement {
77
77
  this.barType = 'action'; // 'title'|'action'
78
78
  this.sharedObserver = undefined;
79
79
  this.disableActionGroup = false;
80
- this.modal = undefined;
81
80
  this.tokenDelay = 120; // in seconds
82
81
 
83
82
  // private props
@@ -310,15 +309,9 @@ export default class IABookActions extends LitElement {
310
309
 
311
310
  /** @returns HTMLElement */
312
311
  get modal() {
313
- let modalOnDom = document.querySelector('modal-manager');
312
+ const modalOnDom = document.querySelector('modal-manager');
314
313
 
315
- if (!modalOnDom) {
316
- const newModal = document.createElement('modal-manager');
317
- document.body.appendChild(newModal);
318
- modalOnDom = newModal;
319
- }
320
-
321
- this.modal.id = 'action-bar-modal';
314
+ modalOnDom.id = 'action-bar-modal';
322
315
  return modalOnDom;
323
316
  }
324
317
 
@@ -669,8 +662,7 @@ export default class IABookActions extends LitElement {
669
662
 
670
663
  // close the modal
671
664
  this.modal.removeAttribute('id');
672
- this.modal?.remove();
673
- this.modal?.showModal({ config: {}, customModalContent: `` });
665
+ this.modal.closeModal();
674
666
 
675
667
  window?.Sentry?.captureMessage(sentryLogs.bookHasRenewed);
676
668
  }