From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 95D2EE00D95; Tue, 29 Sep 2015 10:50:35 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.175 listed in list.dnswl.org] Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id CAF6BE00747 for ; Tue, 29 Sep 2015 10:50:34 -0700 (PDT) Received: by wicgb1 with SMTP id gb1so160288482wic.1 for ; Tue, 29 Sep 2015 10:50:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=5mFl4raTk3dnwsteFXg7o0wgVorhvWUFaWp375mGo20=; b=gJ8vXU4N1PoKqPEOVYdiJ3F8aEGNEIlnTzPxLKPAdhH8wb504SgupLuAm345CWACPJ 752u5cUmYfvvC1jHYr/vugZeA+tJ66ynLL+Rx4+Jm9qO7ZRGao4tC9r9ETgGhWj/MnXu 2EQIpldc/628pWwq6tXgyVUXLB4k660SWBjHxdgzkupcp8EA9hqibSnRvT4f/RS0WkS8 Sps7KlJzZFRkKcCmti1B3hPR8BVTQfMKx/0PY0Mez/jhb4c7qf5YXNmrdT9K+ARpDeeK o1HuUEIeUCCK+S21+Ct/zd/Jg0Z3YMrXZZe9wGPCH6fDxXSOx3ICUduUSeiVS+FCralh eWWQ== X-Gm-Message-State: ALoCoQk3LPKfa8CVv3SVFxl12NH51NHfIj2xmtyuabhDQ8qmR5FAEH1xQdzp6s7tJwF/nVyl3R1+ X-Received: by 10.180.12.195 with SMTP id a3mr25745420wic.71.1443549033925; Tue, 29 Sep 2015 10:50:33 -0700 (PDT) Received: from [192.168.0.22] ([90.212.179.178]) by smtp.googlemail.com with ESMTPSA id x9sm25048956wjf.44.2015.09.29.10.50.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Sep 2015 10:50:33 -0700 (PDT) Message-ID: <560ACF68.2050903@intel.com> Date: Tue, 29 Sep 2015 18:50:32 +0100 From: Michael Wood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: toaster@yoctoproject.org, Elliot Smith References: <1442243364-14257-1-git-send-email-elliot.smith@intel.com> <1442243364-14257-2-git-send-email-elliot.smith@intel.com> In-Reply-To: <1442243364-14257-2-git-send-email-elliot.smith@intel.com> Subject: Re: [review-request][PATCH 1/2] 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: Tue, 29 Sep 2015 17:50:35 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 14/09/15 16:09, Elliot Smith wrote: > 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)); If we replace state each time we load, we won't have a back stack to put the tableData into and subsequently pop it out of on the onpopstate event, could you also remove storing the tableData, tableParams in the browser and remove the window.onpopstate handler code as that won't ever fire now. Thanks, Michael