@internetarchive/ia-book-actions 0.1.4-alpha5 → 0.1.4-alpha6

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
@@ -135,7 +135,7 @@
135
135
  let loanTotalTime5Min = { loanTotalTime: 300, loanRenewAtLast: 290, pageChangedInLast: 15 };
136
136
  let loanTotalTime1Hour = { loanTotalTime: 3600, loanRenewAtLast: 600, pageChangedInLast: 900 };
137
137
 
138
- iaBookActions.loanRenewTimeConfig = loanTotalTime5Min;
138
+ iaBookActions.loanRenewTimeConfig = loanTotalTime2Min;
139
139
 
140
140
  let lendingStatus1 = iaBookActions.lendingStatus;
141
141
  let secondsLeftOnLoan = iaBookActions.loanRenewTimeConfig.loanTotalTime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-book-actions",
3
- "version": "0.1.4-alpha5",
3
+ "version": "0.1.4-alpha6",
4
4
  "description": "Bookreader actions for borrowable book",
5
5
  "author": "Internet Archive",
6
6
  "license": "AGPL-3.0-only",
@@ -32,10 +32,10 @@ export default class TimerCountdown extends LitElement {
32
32
  this.loanRenewAtLast = 0;
33
33
 
34
34
  /**
35
- * timer which is not reduced along with timer
35
+ * store time when timer is started
36
36
  * @type {string}
37
37
  */
38
- this.timeWhenTimerStart = undefined;
38
+ this.timeWhenTimerStart = '';
39
39
 
40
40
  /**
41
41
  * delay seconds in setInterval function
@@ -260,19 +260,19 @@ export default class IABookActions extends LitElement {
260
260
  * dispatched this event from bookreader page changed
261
261
  */
262
262
  window.addEventListener('BookReader:userAction', () => {
263
+ console.log('user action executed');
263
264
  this.suppressToast = true;
264
265
 
265
266
  if (this.borrowType === 'browsed') {
266
267
  this.autoLoanRenewChecker(true);
267
268
  }
268
-
269
- return nothing;
270
269
  });
271
270
 
272
271
  /**
273
272
  * detect click-event on document to close toast-template
274
273
  */
275
- document.addEventListener('click', e => {
274
+ window.addEventListener('click', e => {
275
+ console.log('document click executed');
276
276
  if (this.loanRenewHelper && this.loanRenewResult.secondsLeft > 0) {
277
277
  this.suppressToast = true;
278
278
  }