summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-10-05 12:08:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-11 05:33:02 +0100
commita3742a0f68cc10cadcea659b945f526293adb994 (patch)
tree5d4fd661a549cd814785a66f7c2435eee67e1053 /bitbake
parentfa68ae04553235ab381153aa273c4adee2c30309 (diff)
downloadpoky-a3742a0f68cc10cadcea659b945f526293adb994.tar.gz
bitbake: toaster: Don't add new history entries when table data loads
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] (Bitbake rev: 70c5e40a0f77ae4835fb95275621c345f8190240) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/table.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js
index f18034df52..bc81e67a6a 100644
--- a/bitbake/lib/toaster/toastergui/static/js/table.js
+++ b/bitbake/lib/toaster/toastergui/static/js/table.js
@@ -33,14 +33,6 @@ function tableInit(ctx){
33 33
34 loadData(tableParams); 34 loadData(tableParams);
35 35
36 window.onpopstate = function(event){
37 if (event.state){
38 tableParams = event.state.tableParams;
39 /* We skip loadData and just update the table */
40 updateTable(event.state.tableData);
41 }
42 };
43
44 function loadData(tableParams){ 36 function loadData(tableParams){
45 $.ajax({ 37 $.ajax({
46 type: "GET", 38 type: "GET",
@@ -49,10 +41,8 @@ function tableInit(ctx){
49 headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, 41 headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
50 success: function(tableData) { 42 success: function(tableData) {
51 updateTable(tableData); 43 updateTable(tableData);
52 window.history.pushState({ 44 window.history.replaceState(null, null,
53 tableData: tableData, 45 libtoaster.dumpsUrlParams(tableParams));
54 tableParams: tableParams
55 }, null, libtoaster.dumpsUrlParams(tableParams));
56 } 46 }
57 }); 47 });
58 } 48 }