Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

lint lib #3308

Merged
merged 2 commits into from
Aug 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/hammerUtil.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
var Hammer = require('./module/hammer');

/**
* Register a touch event, taking place before a gesture
* @param {Hammer} hammer A hammer instance
Expand Down
15 changes: 8 additions & 7 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ exports.fillIfDefined = function (a, b, allowDeletion = false) {
* @param {... Object} b
* @return {Object} a
*/
exports.protoExtend = function (a, b) {
exports.protoExtend = function (a, b) { // eslint-disable-line no-unused-vars
for (var i = 1; i < arguments.length; i++) {
var other = arguments[i];
for (var prop in other) {
Expand All @@ -158,7 +158,7 @@ exports.protoExtend = function (a, b) {
* @param {... Object} b
* @return {Object} a
*/
exports.extend = function (a, b) {
exports.extend = function (a, b) { // eslint-disable-line no-unused-vars
for (var i = 1; i < arguments.length; i++) {
var other = arguments[i];
for (var prop in other) {
Expand All @@ -178,7 +178,7 @@ exports.extend = function (a, b) {
* @param {Object} b
* @return {Object} a
*/
exports.selectiveExtend = function (props, a, b) {
exports.selectiveExtend = function (props, a, b) { // eslint-disable-line no-unused-vars
if (!Array.isArray(props)) {
throw new Error('Array with property names expected as first argument');
}
Expand Down Expand Up @@ -951,23 +951,24 @@ exports.hexToRGB = function (hex) {
* @returns {*}
*/
exports.overrideOpacity = function (color, opacity) {
var rgb;
if (color.indexOf("rgba") != -1) {
return color;
}
else if (color.indexOf("rgb") != -1) {
var rgb = color.substr(color.indexOf("(") + 1).replace(")", "").split(",");
rgb = color.substr(color.indexOf("(") + 1).replace(")", "").split(",");
return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + opacity + ")"
}
else {
var rgb = exports.hexToRGB(color);
rgb = exports.hexToRGB(color);
if (rgb == null) {
return color;
}
else {
return "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + "," + opacity + ")"
}
}
}
};

/**
*
Expand Down Expand Up @@ -1461,7 +1462,7 @@ exports.binarySearchValue = function (orderedItems, target, field, sidePreferenc
var high = orderedItems.length - 1;
var prevValue, value, nextValue, middle;

var comparator = comparator != undefined ? comparator : function (a, b) {
comparator = comparator != undefined ? comparator : function (a, b) {
return a == b ? 0 : a < b ? -1 : 1
};

Expand Down