upgrade eslint and associated fixes

don't keep ie() by the way
This commit is contained in:
JFH
2020-12-19 20:42:18 +01:00
parent dca89321d4
commit 047e55c7be
25 changed files with 346 additions and 352 deletions

View File

@@ -30,7 +30,6 @@ const svg = document.createElementNS(NS.SVG, 'svg');
const isOpera_ = Boolean(window.opera);
const isWebkit_ = userAgent.includes('AppleWebKit');
const isGecko_ = userAgent.includes('Gecko/');
const isIE_ = userAgent.includes('MSIE');
const isChrome_ = userAgent.includes('Chrome/');
const isWindows_ = userAgent.includes('Windows');
const isMac_ = userAgent.includes('Macintosh');
@@ -165,11 +164,6 @@ export const isWebkit = () => isWebkit_;
* @returns {boolean}
*/
export const isGecko = () => isGecko_;
/**
* @function module:browser.isIE
* @returns {boolean}
*/
export const isIE = () => isIE_;
/**
* @function module:browser.isChrome
* @returns {boolean}

View File

@@ -230,13 +230,8 @@ export const convertAttrs = function (element) {
for (let i = 0; i < len; i++) {
const attr = attrs[i];
const cur = element.getAttribute(attr);
if (cur) {
if (!isNaN(cur)) {
element.setAttribute(attr, (cur / typeMap_[unit]) + unit);
}
// else {
// Convert existing?
// }
if (cur && !isNaN(cur)) {
element.setAttribute(attr, (cur / typeMap_[unit]) + unit);
}
}
};

View File

@@ -679,10 +679,8 @@ export const getBBox = function (elem) {
} else {
// Check if element is child of a foreignObject
const fo = $(selected).closest('foreignObject');
if (fo.length) {
if (fo[0].getBBox) {
ret = fo[0].getBBox();
}
if (fo.length && fo[0].getBBox) {
ret = fo[0].getBBox();
}
}
}