mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 15:43:48 +00:00
New eslint rules auto fix (#3058)
* no-implicit-coercion and no-unneeded-ternary * End every line with a semicolon * Spacing and formatting * Enabled semi-spacing * Applies npm run lint:fix to code after master merge * Fix merge issues * Switched operator-linebreak to 'before' Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
@ -74,15 +74,17 @@ define(["zepto"], function ($) {
|
||||
fileReader.onerror = function () {
|
||||
return reject(event.target.result);
|
||||
};
|
||||
|
||||
fileReader.readAsText(file);
|
||||
});
|
||||
};
|
||||
|
||||
FileInputService.prototype.newInput = function () {
|
||||
FileInputService.prototype.newInput = function () {
|
||||
var input = $(document.createElement('input'));
|
||||
input.attr("type", "file");
|
||||
input.css("display", "none");
|
||||
$('body').append(input);
|
||||
|
||||
return input;
|
||||
};
|
||||
|
||||
|
@ -34,9 +34,9 @@ define(
|
||||
function link(scope, element, attrs, control) {
|
||||
|
||||
function setText(fileName) {
|
||||
scope.structure.text = fileName.length > 20 ?
|
||||
fileName.substr(0, 20) + "..." :
|
||||
fileName;
|
||||
scope.structure.text = fileName.length > 20
|
||||
? fileName.substr(0, 20) + "..."
|
||||
: fileName;
|
||||
}
|
||||
|
||||
function handleClick() {
|
||||
|
@ -59,6 +59,7 @@ define(
|
||||
if ($scope.optionIndex === 0) {
|
||||
$scope.optionIndex = $scope.filteredOptions.length;
|
||||
}
|
||||
|
||||
$scope.optionIndex--;
|
||||
fillInputWithIndexedOption();
|
||||
}
|
||||
@ -67,6 +68,7 @@ define(
|
||||
if ($scope.optionIndex === $scope.filteredOptions.length - 1) {
|
||||
$scope.optionIndex = -1;
|
||||
}
|
||||
|
||||
$scope.optionIndex++;
|
||||
fillInputWithIndexedOption();
|
||||
}
|
||||
@ -90,7 +92,7 @@ define(
|
||||
incrementOptionIndex();
|
||||
break;
|
||||
case key.up:
|
||||
$event.preventDefault(); // Prevents cursor jumping back and forth
|
||||
$event.preventDefault(); // Prevents cursor jumping back and forth
|
||||
decrementOptionIndex();
|
||||
break;
|
||||
case key.enter:
|
||||
|
@ -47,9 +47,9 @@ define(
|
||||
|
||||
function toGradient(triplet, value) {
|
||||
return triplet.map(function (v) {
|
||||
return Math.round(value > 0 ?
|
||||
(v + (255 - v) * value) :
|
||||
(v * (1 + value))
|
||||
return Math.round(value > 0
|
||||
? (v + (255 - v) * value)
|
||||
: (v * (1 + value))
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -66,6 +66,7 @@ define(
|
||||
Math.round(28.3333 * group.length)
|
||||
]));
|
||||
}
|
||||
|
||||
GROUPS.push(group);
|
||||
|
||||
// Ten basic colors
|
||||
|
@ -96,8 +96,8 @@ define(
|
||||
|
||||
// Initialize forms values
|
||||
updateDateTime(
|
||||
($scope.ngModel && $scope.field) ?
|
||||
$scope.ngModel[$scope.field] : undefined
|
||||
($scope.ngModel && $scope.field)
|
||||
? $scope.ngModel[$scope.field] : undefined
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -120,6 +120,7 @@ define(
|
||||
ngModel.field = imageUrl;
|
||||
console.warn('You cancelled the annotation!!!');
|
||||
}
|
||||
|
||||
done(true);
|
||||
}
|
||||
}).show(imageUrl);
|
||||
|
Reference in New Issue
Block a user