check single element type to be html image element #1
@ -8,13 +8,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// selector provided
|
// selector provided
|
||||||
if (typeof els === 'string') {
|
else if (typeof els === 'string') {
|
||||||
els = document.querySelectorAll(els);
|
els = document.querySelectorAll(els);
|
||||||
}
|
}
|
||||||
|
|
||||||
// single element provided
|
// single element provided (only image element)
|
||||||
if (typeof els.length === 'undefined') {
|
else if (!els instanceof HTMLImageElement) {
|
||||||
els = [els];
|
throw TypeError("Can not apply Snaphash to " + els.constructor.name + " type. You must provide an image element/selector");
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop over elements
|
// loop over elements
|
||||||
|
Loading…
Reference in New Issue
Block a user