mirror of https://github.com/zulip/zulip.git
zjquery: Allow $.Event as a constructor.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
5a87c34705
commit
f84fd0839d
|
@ -6,6 +6,9 @@ const noop = function () {};
|
|||
|
||||
class Event {
|
||||
constructor(type, props) {
|
||||
if (!(this instanceof Event)) {
|
||||
return new Event(type, props);
|
||||
}
|
||||
this.type = type;
|
||||
Object.assign(this, props);
|
||||
}
|
||||
|
@ -518,7 +521,7 @@ exports.make_zjquery = function (opts) {
|
|||
return res;
|
||||
};
|
||||
|
||||
zjquery.Event = (type, props) => new Event(type, props);
|
||||
zjquery.Event = Event;
|
||||
|
||||
fn.after = function (s) {
|
||||
return s;
|
||||
|
|
Loading…
Reference in New Issue