All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Wood <michael.g.wood@intel.com>
To: toaster@yoctoproject.org, Elliot Smith <elliot.smith@intel.com>
Subject: Re: [review-request][PATCH 1/2] toaster: Don't add new history entries when table data loads
Date: Tue, 29 Sep 2015 18:50:32 +0100	[thread overview]
Message-ID: <560ACF68.2050903@intel.com> (raw)
In-Reply-To: <1442243364-14257-2-git-send-email-elliot.smith@intel.com>

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 <elliot.smith@intel.com>
> ---
>   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


  reply	other threads:[~2015-09-29 17:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 15:09 [review-request][PATCH 0/2] Prevent stale data in ToasterTables Elliot Smith
2015-09-14 15:09 ` [review-request][PATCH 1/2] toaster: Don't add new history entries when table data loads Elliot Smith
2015-09-29 17:50   ` Michael Wood [this message]
2015-09-30  9:00     ` Smith, Elliot
2015-10-05 11:13       ` Michael Wood
2015-09-14 15:09 ` [review-request][PATCH 2/2] toaster: Don't HTTP cache ToasterTable responses Elliot Smith
2015-09-16 11:32   ` [PATCH] toaster: layerdetails Fix back button tab behaviour Michael Wood
2015-09-20 20:27     ` Brian Avery
2015-09-21  8:35       ` Smith, Elliot
2015-09-21  8:43         ` Smith, Elliot
2015-09-21 14:41           ` Brian Avery
2015-09-22  2:44             ` Brian Avery
2015-09-15 10:50 ` [review-request][PATCH 0/2] Prevent stale data in ToasterTables Barros Pena, Belen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560ACF68.2050903@intel.com \
    --to=michael.g.wood@intel.com \
    --cc=elliot.smith@intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.