hof 22.0.0-timeout-warning-beta.2 → 22.0.0-timeout-warning-beta.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -286,7 +286,6 @@ var skipToMain = require('./skip-to-main');
286
286
  var cookie = require('./govuk-cookies');
287
287
  var cookieSettings = require('./cookieSettings');
288
288
  var sessionDialog = require('./session-timeout-dialog');
289
- GOVUK.sessionDialog.init();
290
289
 
291
290
  toolkit.detailsSummary();
292
291
 
@@ -341,7 +340,7 @@ window.GOVUK.sessionDialog = {
341
340
  },
342
341
 
343
342
  isDialogOpen: function () {
344
- return window.GOVUK.sessionDialog.el.open;
343
+ return window.GOVUK.sessionDialog.el && window.GOVUK.sessionDialog.el.open;
345
344
  },
346
345
 
347
346
  isConfigured: function () {
@@ -358,6 +357,7 @@ window.GOVUK.sessionDialog = {
358
357
  window.GOVUK.sessionDialog.saveLastFocusedEl();
359
358
  window.GOVUK.sessionDialog.makePageContentInert();
360
359
  window.GOVUK.sessionDialog.el.showModal();
360
+ window.GOVUK.sessionDialog.el.open = true;
361
361
  }
362
362
  },
363
363
 
@@ -365,6 +365,7 @@ window.GOVUK.sessionDialog = {
365
365
  if (window.GOVUK.sessionDialog.isDialogOpen()) {
366
366
  $('html, body').removeClass(window.GOVUK.sessionDialog.dialogIsOpenClass);
367
367
  window.GOVUK.sessionDialog.el.close();
368
+ window.GOVUK.sessionDialog.el.open = false;
368
369
  window.GOVUK.sessionDialog.setFocusOnLastFocusedEl();
369
370
  window.GOVUK.sessionDialog.removeInertFromPageContent();
370
371
  window.GOVUK.sessionDialog.refreshSession();
@@ -430,7 +431,7 @@ window.GOVUK.sessionDialog = {
430
431
  /* Array of scales as words */
431
432
  const scales = ['', 'thousand', 'million', 'billion', 'trillion', 'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', 'nonillion', 'decillion', 'undecillion', 'duodecillion', 'tredecillion', 'quatttuor-decillion', 'quindecillion', 'sexdecillion', 'septen-decillion', 'octodecillion', 'novemdecillion', 'vigintillion', 'centillion'];
432
433
 
433
- /* Split user arguemnt into 3 digit chunks from right to left */
434
+ /* Split user argument into 3 digit chunks from right to left */
434
435
  start = string.length;
435
436
  const chunks = [];
436
437
  while (start > 0) {
@@ -532,7 +533,7 @@ window.GOVUK.sessionDialog = {
532
533
 
533
534
  (function countdown() {
534
535
  const secondsUntilSessionTimeout = window.GOVUK.sessionDialog.secondsUntilSessionTimeout();
535
- const timerExpired = secondsUntilSessionTimeout <= window.GOVUK.sessionDialog.secondsFinalWarning;
536
+ const timerExpired = secondsUntilSessionTimeout <= 0;
536
537
 
537
538
  if (!timerExpired) {
538
539
  const minutesLeft = parseInt(secondsUntilSessionTimeout / 60, 10);
@@ -632,6 +633,7 @@ window.GOVUK.sessionDialog = {
632
633
  }
633
634
  }
634
635
  };
636
+ window.GOVUK.sessionDialog.init();
635
637
 
636
638
  },{"jquery":14}],5:[function(require,module,exports){
637
639
  const skipToMain = function () {