preline
Version:
Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
30 lines (25 loc) • 682 B
text/typescript
import HSFileUpload from './core';
declare var _: any;
declare var Dropzone: any;
window.addEventListener('load', () => {
if (
document.querySelectorAll(
'[data-hs-file-upload]:not(.--prevent-on-load-init)',
).length
) {
if (typeof _ === 'undefined')
console.error(
'HSFileUpload: Lodash is not available, please add it to the page.',
);
if (typeof Dropzone === 'undefined')
console.error(
'HSFileUpload: Dropzone is not available, please add it to the page.',
);
}
if (typeof _ !== 'undefined' && typeof Dropzone !== 'undefined') {
HSFileUpload.autoInit();
}
});
if (typeof window !== 'undefined') {
window.HSFileUpload = HSFileUpload;
}