Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 1376BE00EFF; Thu, 1 Oct 2015 02:33:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.93 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 0F709E00E8D for ; Thu, 1 Oct 2015 02:33:39 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 01 Oct 2015 02:33:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,616,1437462000"; d="scan'208";a="817035467" Received: from mhalasin-mobl.ger.corp.intel.com (HELO lp.ger.corp.intel.com) ([10.252.25.78]) by orsmga002.jf.intel.com with ESMTP; 01 Oct 2015 02:33:37 -0700 From: Elliot Smith To: toaster@yoctoproject.org Date: Thu, 1 Oct 2015 10:33:28 +0100 Message-Id: <1443692010-14895-2-git-send-email-elliot.smith@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1443692010-14895-1-git-send-email-elliot.smith@intel.com> References: <1443692010-14895-1-git-send-email-elliot.smith@intel.com> Subject: [review-request][PATCH 1/3] toaster: Don't add new history entries when table data loads X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2015 09:33:40 -0000 When ToasterTable data is loaded into the UI, a new entry is added to the browser history. This means that pressing the back button appears to have no effect, as you end up at the same page, possibly with slightly different data. Instead, use replaceState(), so that the browser history doesn't grow, but the page context still gets updated. [YOCTO #7660] Signed-off-by: Elliot Smith --- bitbake/lib/toaster/toastergui/static/js/table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index f18034d..99b99a0 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -49,7 +49,7 @@ function tableInit(ctx){ headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, success: function(tableData) { updateTable(tableData); - window.history.pushState({ + window.history.replaceState({ tableData: tableData, tableParams: tableParams }, null, libtoaster.dumpsUrlParams(tableParams)); -- Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.