From: Stephen Finucane Date: Mon, 1 Oct 2018 21:36:41 +0000 (+0100) Subject: templates: Avoid recursive call X-Git-Tag: v2.2.0-rc1~264 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ae154148c78a75ff73c3c22f0ff0c6b3a3d01408;p=thirdparty%2Fpatchwork.git templates: Avoid recursive call We had registered an event handler on a checkbox in table header which would call a function, 'checkboxes', on all checkboxes within that table. This function, in turn, causes does its work and then triggers event handlers for all modified checkboxes which include the original table header checkbox. This resulted in the original event calling itself recursively. Resolve this by only modifying the checkboxes in the table body. Signed-off-by: Stephen Finucane Fixes: 44fe7bae ("js: Allow shift-select of checkboxes") --- diff --git a/patchwork/templates/patchwork/partials/patch-list.html b/patchwork/templates/patchwork/partials/patch-list.html index 53d577de..2abb9ec2 100644 --- a/patchwork/templates/patchwork/partials/patch-list.html +++ b/patchwork/templates/patchwork/partials/patch-list.html @@ -41,9 +41,9 @@ $(document).ready(function() { $('#check-all').change(function(e) { if(this.checked) { - $('#patchlist').checkboxes('check'); + $('#patchlist > tbody').checkboxes('check'); } else { - $('#patchlist').checkboxes('uncheck'); + $('#patchlist > tbody').checkboxes('uncheck'); } e.preventDefault(); });