@textback/notification-widget
Version:
TODO: Give a short introduction of your project. Let this section explain the objectives or the motivation behind this project.
29 lines (22 loc) • 714 B
JavaScript
import Widget from './components/tb-notification-widget/index.js';
const locales = require('./locales');
Widget.locales = locales;
Widget.VERSION = VERSION; // provided by webpack
function initializeWidgets() {
const widgetElements = document.getElementsByTagName(Widget.tagName);
if (widgetElements) {
for (let i = 0; i < widgetElements.length; i++) {
new Widget({
element: widgetElements[i]
});
}
}
}
if (!window.TextBack.NotificationWidget) {
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeWidgets);
} else {
initializeWidgets();
}
}
export default Widget;