diff --git a/Gruntfile.js b/Gruntfile.js index 21d679e..14d4f61 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -104,6 +104,6 @@ module.exports = function(grunt) { grunt.registerTask('test', ['test:unit', 'test:functional']); // Default task. - grunt.registerTask('default', ['jshint', 'jasmine', 'concat', 'uglify']); + grunt.registerTask('default', ['jshint', 'concat', 'uglify']); }; diff --git a/dist/rxp-js.js b/dist/rxp-js.js index fe61875..6b7b1ef 100644 --- a/dist/rxp-js.js +++ b/dist/rxp-js.js @@ -1,4 +1,4 @@ -/*! rxp-js - v1.4.0 - 2021-05-18 +/*! rxp-js - v1.5.0 - 2021-07-27 * The official Realex Payments JS Library * https://github.com/realexpayments/rxp-js * Licensed MIT @@ -367,15 +367,18 @@ var RealexHpp = (function () { iFrame.style.transform = "scale(1)"; iFrame.style.backgroundColor = "#ffffff"; - if (spinner.parentNode) { + if (spinner && spinner.parentNode) { spinner.parentNode.removeChild(spinner); } closeButton = internal.createCloseButton(); - overlayElement.appendChild(closeButton); - closeButton.addEventListener("click", function () { - internal.closeModal(closeButton, iFrame, spinner, overlayElement); - }, true); + + if (overlayElement && closeButton) { + overlayElement.appendChild(closeButton); + closeButton.addEventListener("click", function () { + internal.closeModal(closeButton, iFrame, spinner, overlayElement); + }, true); + } }; var form = internal.createForm(document, token); diff --git a/dist/rxp-js.min.js b/dist/rxp-js.min.js index 6273524..56ad758 100644 --- a/dist/rxp-js.min.js +++ b/dist/rxp-js.min.js @@ -1,7 +1,7 @@ -/*! rxp-js - v1.4.0 - 2021-05-18 +/*! rxp-js - v1.5.0 - 2021-07-27 * The official Realex Payments JS Library * https://github.com/realexpayments/rxp-js * Licensed MIT */ -Element.prototype.remove=function(){this.parentElement.removeChild(this)},NodeList.prototype.remove=HTMLCollection.prototype.remove=function(){for(var e=this.length-1;e>=0;e--)this[e]&&this[e].parentElement&&this[e].parentElement.removeChild(this[e])};var RealexHpp=function(){"use strict";var e,t,n="https://pay.realexpayments.com/pay",A=A||Math.random().toString(16).substr(2,8),i=360,o=/Windows Phone|IEMobile/.test(navigator.userAgent),r=/Android|iPad|iPhone|iPod/.test(navigator.userAgent),a=function(){return(window.innerWidth>0?window.innerWidth:screen.width)<=i||(window.innerHeight>0?window.innerHeight:screen.Height)<=i},d=o,s=function(){return!o&&(r||a())},c={evtMsg:[],addEvtMsgListener:function(e){this.evtMsg.push({fct:e,opt:!1}),window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent("message",e)},removeOldEvtMsgListener:function(){if(this.evtMsg.length>0){var e=this.evtMsg.pop();window.addEventListener?window.removeEventListener("message",e.fct,e.opt):window.detachEvent("message",e.fct)}},base64:{encode:function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=escape(e);var n,A,i,o,r,a="",d="",s="",c=0;do{i=(n=e.charCodeAt(c++))>>2,o=(3&n)<<4|(A=e.charCodeAt(c++))>>4,r=(15&A)<<2|(d=e.charCodeAt(c++))>>6,s=63&d,isNaN(A)?r=s=64:isNaN(d)&&(s=64),a=a+t.charAt(i)+t.charAt(o)+t.charAt(r)+t.charAt(s),n=A=d="",i=o=r=s=""}while(c