From f8557e0070e37ccea3b7491bb63593cb9e4a9982 Mon Sep 17 00:00:00 2001 From: eykd Date: Thu, 22 Oct 2015 16:11:23 -0700 Subject: [PATCH] Fix bad reference to this So, my earlier fix was misunderstanding the situation. Inside a `filter()` lambda, `this` is bound to the current DOM object. In order to call `attr()` on it, we first need to wrap it in a jQuery object. --- games/media/js/undum.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/games/media/js/undum.js b/games/media/js/undum.js index 0d04d3b..744bfd9 100644 --- a/games/media/js/undum.js +++ b/games/media/js/undum.js @@ -1619,9 +1619,8 @@ a.replaceWith($("").addClass("ex_link").html(a.html())); }); var contentToHide = $('#content .transient, #content ul.options'); - var that = this; contentToHide.add($("#content a").filter(function(){ - return that.attr("href").match(/[?&]transient[=&]?/); + return $(this).attr("href").match(/[?&]transient[=&]?/); })); if (interactive) { if (mobile) {