Skip to content

Commit

Permalink
changed javascript ES6 syntax to ES5 in order to maintain compatibili…
Browse files Browse the repository at this point in the history
…ty with internet explorer
  • Loading branch information
klues committed May 15, 2018
1 parent e9efc9f commit 341ee4f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ angular.module(asterics.appServices)
return _deviceMappings[device].hardware[0];
} else {
var allPossibilities = thiz.getHardwarePossibilities(device);
return allPossibilities.filter(possibility => _.includes(possibility, existingHardware))[0];
return allPossibilities.filter(function(possibility) {
return _.includes(possibility, existingHardware)
})[0];
}
}
return null;
Expand Down Expand Up @@ -98,7 +100,9 @@ angular.module(asterics.appServices)
thiz.getComputerConfiguredHardwarePossibilities = function(device) {
var allPossibilities = thiz.getHardwarePossibilities(device);
var flattenedPossibilities = [].concat.apply([], allPossibilities);
return _.uniq(flattenedPossibilities).filter(element => _.includes(_computerConfiguredHardware, element));
return _.uniq(flattenedPossibilities).filter(function(element) {
return _.includes(_computerConfiguredHardware, element)
});
};

thiz.getNeededAccessories = function (hardwareName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ angular.module(asterics.appServices)
* @returns {*}
*/
function getHardware(hardwareIds) {
return _allHardware.filter(hardware => _.includes(hardwareIds, hardware.getName()));
return _allHardware.filter(function(hardware) {
return _.includes(hardwareIds, hardware.getName());
});
}

/**
Expand All @@ -154,7 +156,9 @@ angular.module(asterics.appServices)
* @returns {*}
*/
function getSingleHardware(hardwareId) {
var list = _allHardware.filter(hardware => hardwareId == hardware.getName());
var list = _allHardware.filter(function(hardware) {
return hardwareId == hardware.getName();
});
if(list.length == 1) {
return list[0];
} else {
Expand All @@ -168,7 +172,9 @@ angular.module(asterics.appServices)
var returned = false;
var promises = [];
var hardwareInstances = getHardware(possibleHardwareList);
hardwareInstances = hardwareInstances.filter(e => e !== ignoreHardware); //remove ignored hardware
hardwareInstances = hardwareInstances.filter(function(e) { //remove ignored hardware
return e !== ignoreHardware;
});
if (hardwareInstances.length == 0) {
returnDef.resolve(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ angular.module(asterics.appComponents)
var thiz = this;
thiz.singlePageMode = !!$stateParams.singlePageMode;
thiz.breadCrumbStates = stateUtilService.getBreadCrumbStates();
thiz.isMockMode = window.location.href.includes("mock.html");
thiz.isMockMode = window.location.href.indexOf("mock.html") != -1;
thiz.selectedLanguage = _.find(asterics.const.languages, function (lang) {
return _.includes(navigator.language, lang);
}) || asterics.const.I18N_DE;
Expand Down

0 comments on commit 341ee4f

Please sign in to comment.