mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
silence eslint undefined function errors
This commit is contained in:
parent
a3228a55a2
commit
5c0f315a22
@ -1,3 +1,10 @@
|
||||
// Prevent eslint errors on functions defined in other files.
|
||||
/*global
|
||||
ExtraNetworksClusterizeTreeList,
|
||||
ExtraNetworksClusterizeCardsList,
|
||||
*/
|
||||
/*eslint no-undef: "error"*/
|
||||
|
||||
const SEARCH_INPUT_DEBOUNCE_TIME_MS = 250;
|
||||
|
||||
const re_extranet = /<([^:^>]+:[^:]+):[\d.]+>(.*)/;
|
||||
@ -23,7 +30,7 @@ const isStringLogError = x => {
|
||||
console.error("expected string, got:", typeof x);
|
||||
return false;
|
||||
};
|
||||
const isNull = x => typeof x === "null" || x === null;
|
||||
const isNull = x => x === null;
|
||||
const isUndefined = x => typeof x === "undefined" || x === undefined;
|
||||
// checks both null and undefined for simplicity sake.
|
||||
const isNullOrUndefined = x => isNull(x) || isUndefined(x);
|
||||
|
@ -1,3 +1,20 @@
|
||||
// Prevent eslint errors on functions defined in other files.
|
||||
/*global
|
||||
isString,
|
||||
isStringLogError,
|
||||
isNull,
|
||||
isUndefined,
|
||||
isNullOrUndefined,
|
||||
isNullOrUndefinedLogError,
|
||||
isElement,
|
||||
isElementLogError,
|
||||
getElementByIdLogError,
|
||||
querySelectorLogError,
|
||||
waitForElement,
|
||||
Clusterize
|
||||
*/
|
||||
/*eslint no-undef: "error"*/
|
||||
|
||||
const JSON_UPDATE_DEBOUNCE_TIME_MS = 250;
|
||||
const RESIZE_DEBOUNCE_TIME_MS = 250;
|
||||
// Collators used for sorting.
|
||||
@ -89,15 +106,6 @@ const htmlStringToElement = function(str) {
|
||||
return tmp.body.firstElementChild;
|
||||
};
|
||||
|
||||
const getComputedValue = function(container, css_property) {
|
||||
/** Gets a property value for the computed style of an element. */
|
||||
return parseInt(
|
||||
window.getComputedStyle(container, null)
|
||||
.getPropertyValue(css_property)
|
||||
.split("px")[0]
|
||||
);
|
||||
};
|
||||
|
||||
const calcColsPerRow = function(parent, child) {
|
||||
/** Calculates the number of columns of children that can fit in a parent's visible width. */
|
||||
const parent_inner_width = parent.offsetWidth - getComputedPaddingDims(parent).width;
|
||||
|
Loading…
Reference in New Issue
Block a user