fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-04-21 11:52 am

[dw-free] Quick Reply in site scheme swallows up all click events

[commit: http://hg.dwscoalition.org/dw-free/rev/6b78ac69e1ce]

http://bugs.dwscoalition.org/show_bug.cgi?id=3634

Make the "this" variable point to the clicked link, not to the entire
window, so that it doesn't swallow up all other clicked events (and so that
clicking other links will still work).

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/weblib.pl
--------------------------------------------------------------------------------
diff -r b4d9f3a14173 -r 6b78ac69e1ce cgi-bin/weblib.pl
--- a/cgi-bin/weblib.pl	Thu Apr 21 10:13:47 2011 +0800
+++ b/cgi-bin/weblib.pl	Thu Apr 21 19:52:01 2011 +0800
@@ -1058,7 +1058,7 @@ sub make_qr_link
         $basesubject =~ s/^(Re:\s*)*//i;
         $basesubject = "Re: $basesubject" if $basesubject;
         $basesubject = LJ::ehtml(LJ::ejs($basesubject));
-        my $onclick = "return quickreply(\"$dtid\", $pid, \"$basesubject\")";
+        my $onclick = "return function(that) { return quickreply(\"$dtid\", $pid, \"$basesubject\", that)}(this)";
 
         my $r = DW::Request->get;
         my $ju;
--------------------------------------------------------------------------------