<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 29 September 2015 at 18:50, Michael Wood <span dir="ltr"><<a href="mailto:michael.g.wood@intel.com" target="_blank">michael.g.wood@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 14/09/15 16:09, Elliot Smith wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
When ToasterTable data is loaded into the UI, a new entry is<br>
added to the browser history. This means that pressing the back<br>
button appears to have no effect, as you end up at the same page,<br>
possibly with slightly different data.<br>
<br>
Instead, use replaceState(), so that the browser history doesn't<br>
grow, but the page context still gets updated.<br>
<br>
[YOCTO #7660]<br>
<br>
Signed-off-by: Elliot Smith <<a href="mailto:elliot.smith@intel.com" target="_blank">elliot.smith@intel.com</a>><br>
---<br>
  bitbake/lib/toaster/toastergui/static/js/table.js | 2 +-<br>
  1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js<br>
index f18034d..99b99a0 100644<br>
--- a/bitbake/lib/toaster/toastergui/static/js/table.js<br>
+++ b/bitbake/lib/toaster/toastergui/static/js/table.js<br>
@@ -49,7 +49,7 @@ function tableInit(ctx){<br>
  Â  Â  Â  Â  headers: { 'X-CSRFToken' : $.cookie('csrftoken')},<br>
  Â  Â  Â  Â  success: function(tableData) {<br>
  Â  Â  Â  Â  Â  updateTable(tableData);<br>
-  Â  Â  Â  Â  window.history.pushState({<br>
+  Â  Â  Â  Â  window.history.replaceState({<br>
  Â  Â  Â  Â  Â  Â  Â  tableData: tableData,<br>
  Â  Â  Â  Â  Â  Â  Â  tableParams: tableParams<br>
  Â  Â  Â  Â  Â  }, null, libtoaster.dumpsUrlParams(tableParams));<br>
</blockquote>
<br>
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.<br></blockquote><div><br></div><div>Thanks for the review.</div><div><br></div><div>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.</div><div><br></div><div>Thanks.</div><div>Elliot</div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Elliot Smith<br>Software Engineer<br>Intel Open Source Technology Centre</div></div></div>
</div></div>