summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-09-21 19:45:24 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 22:44:55 +0100
commit767fe69fd045e9d1c0b9da4ae605b6f55f10e11e (patch)
treef65145e18fa98001047fed4667d54dddfb655330 /bitbake
parent4c0320ffc06fa0fcae2976a8c7c997fc0c823674 (diff)
downloadpoky-767fe69fd045e9d1c0b9da4ae605b6f55f10e11e.tar.gz
bitbake: toaster: layerdetails Fix back button tab behaviour
This completes the behaviour fix of the back button in the layerdetails page as we not only have parameters in our history we also have the hash to indicate which tab is active. As we pop our history we need to show the corresponding tab. [YOCTO #8252] (Bitbake rev: 8fc7f94af19cd8489a944b02d9a406bd62d001fa) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/layerdetails.js28
1 files changed, 23 insertions, 5 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
index 000e8038f6..8817b47c6b 100644
--- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
+++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js
@@ -7,6 +7,9 @@ function layerDetailsPageInit (ctx) {
7 var layerDepsList = $("#layer-deps-list"); 7 var layerDepsList = $("#layer-deps-list");
8 var currentLayerDepSelection; 8 var currentLayerDepSelection;
9 var addRmLayerBtn = $("#add-remove-layer-btn"); 9 var addRmLayerBtn = $("#add-remove-layer-btn");
10 var targetTab = $("#targets-tab");
11 var machineTab = $("#machines-tab");
12 var detailsTab = $("#details-tab");
10 13
11 /* setup the dependencies typeahead */ 14 /* setup the dependencies typeahead */
12 libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "true" }, function(item){ 15 libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "true" }, function(item){
@@ -15,6 +18,21 @@ function layerDetailsPageInit (ctx) {
15 layerDepBtn.removeAttr("disabled"); 18 layerDepBtn.removeAttr("disabled");
16 }); 19 });
17 20
21 $(window).on('hashchange', function(e){
22 switch(window.location.hash){
23 case '#machines':
24 machineTab.tab('show');
25 break;
26 case '#recipes':
27 targetTab.tab('show');
28 break;
29 default:
30 detailsTab.tab('show');
31 break;
32 }
33 });
34
35
18 $(".breadcrumb li:first a").click(function(e){ 36 $(".breadcrumb li:first a").click(function(e){
19 e.preventDefault(); 37 e.preventDefault();
20 /* By default this link goes to the project configuration page. However 38 /* By default this link goes to the project configuration page. However
@@ -143,7 +161,7 @@ function layerDetailsPageInit (ctx) {
143 addRmLayerBtn.removeClass("btn-danger"); 161 addRmLayerBtn.removeClass("btn-danger");
144 } 162 }
145 163
146 $("#details-tab").on('show', function(){ 164 detailsTab.on('show', function(){
147 if (!ctx.layerVersion.inCurrentPrj) 165 if (!ctx.layerVersion.inCurrentPrj)
148 defaultAddBtnText(); 166 defaultAddBtnText();
149 167
@@ -174,7 +192,7 @@ function layerDetailsPageInit (ctx) {
174 $("#no-recipes-yet").hide(); 192 $("#no-recipes-yet").hide();
175 } 193 }
176 194
177 $("#targets-tab").removeClass("muted"); 195 targetTab.removeClass("muted");
178 if (window.location.hash === "#recipes"){ 196 if (window.location.hash === "#recipes"){
179 /* re run the machinesTabShow to update the text */ 197 /* re run the machinesTabShow to update the text */
180 targetsTabShow(); 198 targetsTabShow();
@@ -189,7 +207,7 @@ function layerDetailsPageInit (ctx) {
189 else 207 else
190 $("#no-machines-yet").hide(); 208 $("#no-machines-yet").hide();
191 209
192 $("#machines-tab").removeClass("muted"); 210 machineTab.removeClass("muted");
193 if (window.location.hash === "#machines"){ 211 if (window.location.hash === "#machines"){
194 /* re run the machinesTabShow to update the text */ 212 /* re run the machinesTabShow to update the text */
195 machinesTabShow(); 213 machinesTabShow();
@@ -202,7 +220,7 @@ function layerDetailsPageInit (ctx) {
202 220
203 }); 221 });
204 222
205 $("#targets-tab").on('show', targetsTabShow); 223 targetTab.on('show', targetsTabShow);
206 224
207 function machinesTabShow(){ 225 function machinesTabShow(){
208 if (!ctx.layerVersion.inCurrentPrj) { 226 if (!ctx.layerVersion.inCurrentPrj) {
@@ -219,7 +237,7 @@ function layerDetailsPageInit (ctx) {
219 window.location.hash = "machines"; 237 window.location.hash = "machines";
220 } 238 }
221 239
222 $("#machines-tab").on('show', machinesTabShow); 240 machineTab.on('show', machinesTabShow);
223 241
224 $(".pagesize").change(function(){ 242 $(".pagesize").change(function(){
225 var search = libtoaster.parseUrlParams(); 243 var search = libtoaster.parseUrlParams();