Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
widget.registerMessages(['beforeDestroy', 'destroy'], false);
// Check if the user's widget has an additional events defined
var allowedEvents = proto.events || OriginalWidgetClass.events;
if (allowedEvents) {
widget.registerMessages(allowedEvents, false);
}
// Add required specified properties required by the Widget mixin methods
if (id) {
widget._id = id;
widget.el = widget.getEl();
}
if (!OriginalWidgetClass.getName) {
OriginalWidgetClass.getName = function() {
return type;
};
}
proto.constructor = OriginalWidgetClass;
if (Widget.legacy) {
widget._parentWidget = parent;
}
if (events) {
widget._events = _convertEvents(events);
}
widget.widgets = new Document(); //This widget might have other widgets scoped within it
// Check if the user's widget has an additional events defined
var allowedEvents = proto.events || OriginalWidgetClass.events;
if (allowedEvents) {
widget.registerMessages(allowedEvents, false);
}
// Add required specified properties required by the Widget mixin methods
if (id) {
widget._id = id;
widget.el = widget.getEl();
}
if (!OriginalWidgetClass.getName) {
OriginalWidgetClass.getName = function() {
return type;
};
}
proto.constructor = OriginalWidgetClass;
if (Widget.legacy) {
widget._parentWidget = parent;
}
if (events) {
widget._events = _convertEvents(events);
}
widget.widgets = new Document(); //This widget might have other widgets scoped within it