mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
zjquery: Add to_$ hook so elements can wrap themselves.
This commit is contained in:
@@ -314,6 +314,15 @@ exports.make_zjquery = function () {
|
||||
return arg;
|
||||
}
|
||||
}
|
||||
|
||||
// We occasionally create stub objects that know
|
||||
// they want to be wrapped by jQuery (so they can
|
||||
// in turn return stubs). The convention is that
|
||||
// they provide a to_$ attribute.
|
||||
if (arg.to_$) {
|
||||
assert(typeof arg.to_$ === "function");
|
||||
return arg.to_$();
|
||||
}
|
||||
}
|
||||
|
||||
if (arg2 !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user