From patchwork Mon Oct 1 21:42:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 977487 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42PG4Z2YSWz9s3x for ; Tue, 2 Oct 2018 07:43:42 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="VXfBGt4N"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42PG4Z0H4RzF3By for ; Tue, 2 Oct 2018 07:43:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="VXfBGt4N"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=that.guru (client-ip=185.234.75.3; helo=relay-direct21.mxroute.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="VXfBGt4N"; dkim-atps=neutral Received: from relay-direct21.mxroute.com (relay-direct21.mxroute.com [185.234.75.3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42PG4V3LfNzF39s for ; Tue, 2 Oct 2018 07:43:37 +1000 (AEST) Received: from filter002.mxroute.com (unknown [185.133.192.179]) by relay-direct21.mxroute.com (Postfix) with ESMTP id 288B03F356 for ; Mon, 1 Oct 2018 21:43:05 +0000 (UTC) Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter002.mxroute.com (Postfix) with ESMTPS id 1BB583F0D5 for ; Mon, 1 Oct 2018 21:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+jLvoXSPNldl7S1MvqAz/7jsNCuh8tq3q2jOI08wz1I=; b=VXfBGt4NhThaA9aV10tiFSJZqP fwMjXs8+naSHPq2c5hf5wA7YEhOJ6Pd7CRaEi+z1v14t8J8CILvAf9r9/iHcXqJlLZuzL5esaZNbq /TJOkYY1IX4i5HTxSm69seUhSLQj3bH9KTqQHs2PaKrFJVKTn6mnUMZ6QZzFWqg9gRIFQgWpdTMWz JvRY9+h+n/SFTyqXbiqgYBpkWpjkynzhSusogk0ASBemS118A501+XJ6DcmLhLgBso76OHJq9t+LX CYPlaHOAIE3yo6XdBe245yjU09su6OQPPCoNnTMc/DXXVTHWDYqaimNn537es2I+5vNUAbgOu89x/ Z/5d0z4A==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH] templates: Avoid recursive call Date: Mon, 1 Oct 2018 22:42:52 +0100 Message-Id: <20181001214252.14345-1-stephen@that.guru> X-Mailer: git-send-email 2.17.1 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" 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 --- This should be backported to stable/2.1. --- patchwork/templates/patchwork/partials/patch-list.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patchwork/templates/patchwork/partials/patch-list.html b/patchwork/templates/patchwork/partials/patch-list.html index 90cb7d78..4ba062ab 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(); });