From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id E4018E00E56; Mon, 5 Oct 2015 04:13:45 -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: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.173 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 33186E00B5D for ; Mon, 5 Oct 2015 04:13:44 -0700 (PDT) Received: by wicge5 with SMTP id ge5so115246347wic.0 for ; Mon, 05 Oct 2015 04:13:43 -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 :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=yPmXKcavGM8Ddcz1ps9TtwV/Z3i6nYvbIujkR6IAILE=; b=hMRczx2/qggAfNivo3yyQWtpoofo4DVGMuXiGNGTbZeu9EfBZgFxmUZ30aO0IUgDNl HXMkTFPTDEYwppHz9NkxzOzw9Loipi/RU6JSGzMmrbyamdaNp/dnv5T9J38lMnmZY0MK 0RZKo+AZKNmv3yeSPZJpBJYxxkL2md/XEFwr0pLQp6FFTLReGirjI5wjJzNoFsV6l2vK ILlHga5BehQhEPysXzRFH/IwxWXCC0j/+nuhpy/4vIDQnxpgX5prVVS3CCAblytnQXNg bXwmth3Cf0nic9M0VtizIEctuffn3MKI4ShVUsHGUsvjpJVEgvUNQwlZ9+WfU1Z5fOsX Tiiw== X-Gm-Message-State: ALoCoQkG8bc4DzZwXBtQlgIFnGRYwzvybVYHEnI6GUTb9apdiEZ4YJRUpJe1+oO1LW2MIsyciCHV X-Received: by 10.180.37.199 with SMTP id a7mr11231381wik.2.1444043623598; Mon, 05 Oct 2015 04:13:43 -0700 (PDT) Received: from [192.168.0.22] ([2.218.205.118]) by smtp.googlemail.com with ESMTPSA id d8sm17857153wiy.1.2015.10.05.04.13.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 04:13:43 -0700 (PDT) Message-ID: <56125B66.4070600@intel.com> Date: Mon, 05 Oct 2015 12:13:42 +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: "Smith, Elliot" References: <1442243364-14257-1-git-send-email-elliot.smith@intel.com> <1442243364-14257-2-git-send-email-elliot.smith@intel.com> <560ACF68.2050903@intel.com> In-Reply-To: Cc: toaster@yoctoproject.org 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: Mon, 05 Oct 2015 11:13:46 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 30/09/15 10:00, Smith, Elliot wrote: > On 29 September 2015 at 18:50, Michael Wood > wrote: > > 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 for the review. > > I've added a commit which (I think) removes the code you're talking > about. It's 0ea00338f688d4b90ab5794cd2bbb181db880d10 on > the elliot/toaster/bad_caching-7660 branch. Could you please verify > that I've understood your comment correctly? If I have, I'll resubmit > the patches. > > Thanks. > Elliot > -- > Elliot Smith > Software Engineer > Intel Open Source Technology Centre > > --------------------------------------------------------------------- > 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. > Thanks. Patches submitted upstream, with a minor fix to keeping the update of the url parameters in the replaceState. Michael