Skip to content

Commit

Permalink
fix(syntax): change javascript lambdas to functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Panelo committed Feb 13, 2019
1 parent 22ebd66 commit 5629e96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions UsabillaSampleApp/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion www/Usabilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5629e96

Please sign in to comment.