Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Commit

Permalink
Got rid of arrow functions (IE11 support)
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Dec 27, 2018
1 parent 6be828a commit a9157cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/default/aura/Lookup/LookupController.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
selectedIds : helper.getSelectedIds(component)
});

action.setCallback(this, (response) => {
action.setCallback(this, function(response) {
const state = response.getState();
if (state === 'SUCCESS') {
helper.toggleSearchSpinner(component);
Expand Down Expand Up @@ -99,7 +99,7 @@
}
// Delay hiding combobox so that we can capture selected result
const blurTimeout = window.setTimeout(
$A.getCallback(() => {
$A.getCallback(function() {
component.set('v.hasFocus', false);
component.set('v.blurTimeout', null);
}),
Expand Down
8 changes: 4 additions & 4 deletions src/main/default/aura/Lookup/LookupHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
clearTimeout(searchTimeout);
}
searchTimeout = window.setTimeout(
$A.getCallback(() => {
$A.getCallback(function() {
// Send search event if it long enougth
const searchTerm = component.get('v.searchTerm');
if (searchTerm.length >= 2) {
Expand All @@ -41,7 +41,7 @@
selectResult : function(component, recordId) {
// Save selection
const searchResults = component.get('v.searchResults');
const selectedResult = searchResults.filter(result => result.id === recordId);
const selectedResult = searchResults.filter(function(result) { return result.id === recordId; });
if (selectedResult.length > 0) {
const selection = component.get('v.selection');
selection.push(selectedResult[0]);
Expand All @@ -56,12 +56,12 @@

getSelectedIds : function(component) {
const selection = component.get('v.selection');
return selection.map(element => element.id);
return selection.map(function(element) { return element.id; });
},

removeSelectedItem : function(component, removedItemId) {
const selection = component.get('v.selection');
const updatedSelection = selection.filter(item => item.id !== removedItemId);
const updatedSelection = selection.filter(function(item) { return item.id !== removedItemId; });
component.set('v.selection', updatedSelection);
},

Expand Down

0 comments on commit a9157cf

Please sign in to comment.