Skip to content

Commit

Permalink
FIX Patch Entwine to ignore missing methods in one()
Browse files Browse the repository at this point in the history
one() wasn't checking for the presence of the given method on the instance
before trying to call it. This fix should be transparent, and resolves an issue
with the changes in #1030.

Fixes #1138.
  • Loading branch information
Garion Herman committed Oct 19, 2020
1 parent 3643b40 commit 7727d10
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/vendor.js

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions thirdparty/jquery-entwine/dist/jquery.entwine-dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,14 @@ catch (e) {
if (funcs[i].selector.matches(el)) {
var ret, tmp_i = el.i, tmp_f = el.f;
el.i = i; el.f = one;
try { ret = funcs[i][funcprop].apply(namespace.$(el), args); }
finally { el.i = tmp_i; el.f = tmp_f; }
try {
if (typeof funcs[i][funcprop] == 'function') {
ret = funcs[i][funcprop].apply(namespace.$(el), args);
}
} finally {
el.i = tmp_i;
el.f = tmp_f;
}
return ret;
}
}
Expand Down
12 changes: 9 additions & 3 deletions thirdparty/jquery-entwine/src/jquery.entwine.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,15 @@ catch (e) {
if (funcs[i].selector.matches(el)) {
var ret, tmp_i = el.i, tmp_f = el.f;
el.i = i; el.f = one;
try { ret = funcs[i][funcprop].apply(namespace.$(el), args); }
finally { el.i = tmp_i; el.f = tmp_f; }
return ret;
try {
if (typeof funcs[i][funcprop] == 'function') {
ret = funcs[i][funcprop].apply(namespace.$(el), args);
}
} finally {
el.i = tmp_i;
el.f = tmp_f;
}
return ret;
}
}
// If we didn't find a entwine-defined function, but there is a non-entwine function to use as a base, try that
Expand Down

0 comments on commit 7727d10

Please sign in to comment.