* [PATCH 0/1] Fix back button tab behaviour
@ 2015-09-22 2:45 brian avery
2015-09-22 2:45 ` [PATCH 1/1] toaster: layerdetails " brian avery
0 siblings, 1 reply; 2+ messages in thread
From: brian avery @ 2015-09-22 2:45 UTC (permalink / raw)
To: bitbake-devel
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.
The following changes since commit 7b86c771c80d0759c2ca0e57c46c4c966f89c49e:
bitbake: bitbake: bb.fetch2.git: Import errno module (2015-09-19 22:38:44 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib bavery/submit/michaelw/20150920_layerdetails_8252
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/submit/michaelw/20150920_layerdetails_8252
Michael Wood (1):
toaster: layerdetails Fix back button tab behaviour
lib/toaster/toastergui/static/js/layerdetails.js | 28 +++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] toaster: layerdetails Fix back button tab behaviour
2015-09-22 2:45 [PATCH 0/1] Fix back button tab behaviour brian avery
@ 2015-09-22 2:45 ` brian avery
0 siblings, 0 replies; 2+ messages in thread
From: brian avery @ 2015-09-22 2:45 UTC (permalink / raw)
To: bitbake-devel
From: Michael Wood <michael.g.wood@intel.com>
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]
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
---
lib/toaster/toastergui/static/js/layerdetails.js | 28 +++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/lib/toaster/toastergui/static/js/layerdetails.js b/lib/toaster/toastergui/static/js/layerdetails.js
index 000e803..8817b47 100644
--- a/lib/toaster/toastergui/static/js/layerdetails.js
+++ b/lib/toaster/toastergui/static/js/layerdetails.js
@@ -7,6 +7,9 @@ function layerDetailsPageInit (ctx) {
var layerDepsList = $("#layer-deps-list");
var currentLayerDepSelection;
var addRmLayerBtn = $("#add-remove-layer-btn");
+ var targetTab = $("#targets-tab");
+ var machineTab = $("#machines-tab");
+ var detailsTab = $("#details-tab");
/* setup the dependencies typeahead */
libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "true" }, function(item){
@@ -15,6 +18,21 @@ function layerDetailsPageInit (ctx) {
layerDepBtn.removeAttr("disabled");
});
+ $(window).on('hashchange', function(e){
+ switch(window.location.hash){
+ case '#machines':
+ machineTab.tab('show');
+ break;
+ case '#recipes':
+ targetTab.tab('show');
+ break;
+ default:
+ detailsTab.tab('show');
+ break;
+ }
+ });
+
+
$(".breadcrumb li:first a").click(function(e){
e.preventDefault();
/* By default this link goes to the project configuration page. However
@@ -143,7 +161,7 @@ function layerDetailsPageInit (ctx) {
addRmLayerBtn.removeClass("btn-danger");
}
- $("#details-tab").on('show', function(){
+ detailsTab.on('show', function(){
if (!ctx.layerVersion.inCurrentPrj)
defaultAddBtnText();
@@ -174,7 +192,7 @@ function layerDetailsPageInit (ctx) {
$("#no-recipes-yet").hide();
}
- $("#targets-tab").removeClass("muted");
+ targetTab.removeClass("muted");
if (window.location.hash === "#recipes"){
/* re run the machinesTabShow to update the text */
targetsTabShow();
@@ -189,7 +207,7 @@ function layerDetailsPageInit (ctx) {
else
$("#no-machines-yet").hide();
- $("#machines-tab").removeClass("muted");
+ machineTab.removeClass("muted");
if (window.location.hash === "#machines"){
/* re run the machinesTabShow to update the text */
machinesTabShow();
@@ -202,7 +220,7 @@ function layerDetailsPageInit (ctx) {
});
- $("#targets-tab").on('show', targetsTabShow);
+ targetTab.on('show', targetsTabShow);
function machinesTabShow(){
if (!ctx.layerVersion.inCurrentPrj) {
@@ -219,7 +237,7 @@ function layerDetailsPageInit (ctx) {
window.location.hash = "machines";
}
- $("#machines-tab").on('show', machinesTabShow);
+ machineTab.on('show', machinesTabShow);
$(".pagesize").change(function(){
var search = libtoaster.parseUrlParams();
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-22 2:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 2:45 [PATCH 0/1] Fix back button tab behaviour brian avery
2015-09-22 2:45 ` [PATCH 1/1] toaster: layerdetails " brian avery
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.