diff --git a/UsabillaSampleApp/www/js/index.js b/UsabillaSampleApp/www/js/index.js index d750405..49df81b 100644 --- a/UsabillaSampleApp/www/js/index.js +++ b/UsabillaSampleApp/www/js/index.js @@ -36,20 +36,19 @@ var app = { }, setButtonsDisabled: function(disabled) { - document.querySelectorAll('button').forEach(item => item.disabled = disabled); + Array.prototype.forEach.call (document.querySelectorAll('button'), function (item) { + item.disabled = disabled; + } ); }, // Update DOM on a Received Event receivedEvent: function(id) { var parentElement = document.getElementById(id); var listeningElement = parentElement.querySelector('.listening'); - var receivedElement = document.querySelectorAll('.received'); + var receivedElement = parentElement.querySelector('.received'); listeningElement.setAttribute('style', 'display:none;'); - - receivedElement.forEach(function(element) { - element.setAttribute('style', 'display:block;'); - }) + receivedElement.setAttribute('style', 'display:block;'); }, initApp: function() { diff --git a/www/Usabilla.js b/www/Usabilla.js index 0b6145d..58877c6 100644 --- a/www/Usabilla.js +++ b/www/Usabilla.js @@ -7,7 +7,7 @@ Usabilla.prototype.initialize = function(success, fail, appId, customVars) { var customVars = customVars || {}; vars['APP_ID'] = appId; - Object.keys(customVars).map((key) => { + Object.keys(customVars).map(function(key) { var value = customVars[key]; if (typeof value != "object") { vars[key] = value;