mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
added bad input feedback - warn injection
This commit is contained in:
12
js/Util.js
12
js/Util.js
@@ -219,4 +219,16 @@ class Util {
|
||||
if (num && num > 0 && num <= 5000) return true
|
||||
else return false
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {*} param An simple warning injection
|
||||
* @param {*} kind A a string id to identify the warn element
|
||||
*/
|
||||
static warnInjection(param, kind) {
|
||||
if (!param) return;
|
||||
const element = document.createElement('span')
|
||||
element.setAttribute('id', kind)
|
||||
element.textContent = param
|
||||
return element
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user