* [PATCH] toaster: ensure ToasterTable chrome is redrawn when ordering changes @ 2016-03-21 16:16 Elliot Smith 2016-03-23 10:40 ` Barros Pena, Belen 0 siblings, 1 reply; 5+ messages in thread From: Elliot Smith @ 2016-03-21 16:16 UTC (permalink / raw) To: toaster If a ToasterTable is ordered by an optional column and that column is subsequently hidden, the table ordering switches back to the default ordering for the table. However, the table headings don't update to reflect the new ordering. This is because the code which sets the heading weight and hides/shows the caret symbols only runs when the table is first loaded. Remove the guard variable which prevents the table chrome from being set when the table is updated. This resets formatting of the column headings so that the correct heading is highlighted for the ordering which is being used. [YOCTO #9011] Signed-off-by: Elliot Smith <elliot.smith@intel.com> --- bitbake/lib/toaster/toastergui/static/js/table.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index a7e4fba..c8dcd26 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -6,7 +6,6 @@ function tableInit(ctx){ throw "No url supplied for retreiving data"; } - var tableChromeDone = false; var tableTotal = 0; var tableParams = { @@ -178,9 +177,6 @@ function tableInit(ctx){ } function setupTableChrome(tableData){ - if (tableChromeDone === true) - return; - var tableHeadRow = table.find("thead"); var editColMenu = $("#table-chrome-"+ctx.tableName).find(".editcol"); @@ -279,8 +275,6 @@ function tableInit(ctx){ editColMenu.append(toggler); } /* End for each column */ - - tableChromeDone = true; } /* Toggles the active state of the filter button */ -- 1.9.3 --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] toaster: ensure ToasterTable chrome is redrawn when ordering changes 2016-03-21 16:16 [PATCH] toaster: ensure ToasterTable chrome is redrawn when ordering changes Elliot Smith @ 2016-03-23 10:40 ` Barros Pena, Belen 2016-03-23 10:49 ` Smith, Elliot 0 siblings, 1 reply; 5+ messages in thread From: Barros Pena, Belen @ 2016-03-23 10:40 UTC (permalink / raw) To: Smith, Elliot, toaster@yoctoproject.org On 21/03/2016 16:16, "toaster-bounces@yoctoproject.org on behalf of Elliot Smith" <toaster-bounces@yoctoproject.org on behalf of elliot.smith@intel.com> wrote: >If a ToasterTable is ordered by an optional column and that >column is subsequently hidden, the table ordering switches back >to the default ordering for the table. However, the table headings >don't update to reflect the new ordering. This is because the >code which sets the heading weight and hides/shows the caret symbols >only runs when the table is first loaded. > >Remove the guard variable which prevents the table chrome from being >set when the table is updated. This resets formatting of the column >headings so that the correct heading is highlighted for the ordering >which is being used. > >[YOCTO #9011] So, tested this across Toaster (if a table is not on the list, it means the bug doesn't apply because either only one column is sortable, or because none of the sortable columns can be hidden using the 'edit columns' menu). It seems to work in all the tables implemented with ToasterTable * Image recipes * Image recipe details (packages included) * Custom image recipe details (add | remove packages) * Software recipes * Machines * Layers * All builds * Project builds If the scope of the patch is only tables implemented with ToasterTable, then this is good to go. For the sake of completion, this is working in the following tables *not* implemented with ToasterTable * Recipes * Packages It doesn't seem to work in the following tables *not* implemented with ToasterTable * Packages included * Tasks (and by extension Time, CPU time and disk I/O since they are the same as the tasks table). Thanks! Belén > >Signed-off-by: Elliot Smith <elliot.smith@intel.com> >--- > bitbake/lib/toaster/toastergui/static/js/table.js | 6 ------ > 1 file changed, 6 deletions(-) > >diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js >b/bitbake/lib/toaster/toastergui/static/js/table.js >index a7e4fba..c8dcd26 100644 >--- a/bitbake/lib/toaster/toastergui/static/js/table.js >+++ b/bitbake/lib/toaster/toastergui/static/js/table.js >@@ -6,7 +6,6 @@ function tableInit(ctx){ > throw "No url supplied for retreiving data"; > } > >- var tableChromeDone = false; > var tableTotal = 0; > > var tableParams = { >@@ -178,9 +177,6 @@ function tableInit(ctx){ > } > > function setupTableChrome(tableData){ >- if (tableChromeDone === true) >- return; >- > var tableHeadRow = table.find("thead"); > var editColMenu = $("#table-chrome-"+ctx.tableName).find(".editcol"); > >@@ -279,8 +275,6 @@ function tableInit(ctx){ > > editColMenu.append(toggler); > } /* End for each column */ >- >- tableChromeDone = true; > } > > /* Toggles the active state of the filter button */ >-- >1.9.3 > >--------------------------------------------------------------------- >Intel Corporation (UK) Limited >Registered No. 1134945 (England) >Registered Office: Pipers Way, Swindon SN3 1RJ >VAT No: 860 2173 47 > >This e-mail and any attachments may contain confidential material for >the sole use of the intended recipient(s). Any review or distribution >by others is strictly prohibited. If you are not the intended >recipient, please contact the sender and delete all copies. > >-- >_______________________________________________ >toaster mailing list >toaster@yoctoproject.org >https://lists.yoctoproject.org/listinfo/toaster ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] toaster: ensure ToasterTable chrome is redrawn when ordering changes 2016-03-23 10:40 ` Barros Pena, Belen @ 2016-03-23 10:49 ` Smith, Elliot 2016-03-23 10:57 ` Barros Pena, Belen 0 siblings, 1 reply; 5+ messages in thread From: Smith, Elliot @ 2016-03-23 10:49 UTC (permalink / raw) To: Barros Pena, Belen; +Cc: toaster@yoctoproject.org [-- Attachment #1: Type: text/plain, Size: 4095 bytes --] I think I should probably fix those tables, too, even though they're not ToasterTables. Especially since you took the time to test all of them. Elliot On 23 March 2016 at 10:40, Barros Pena, Belen <belen.barros.pena@intel.com> wrote: > > > On 21/03/2016 16:16, "toaster-bounces@yoctoproject.org on behalf of Elliot > Smith" <toaster-bounces@yoctoproject.org on behalf of > elliot.smith@intel.com> wrote: > > >If a ToasterTable is ordered by an optional column and that > >column is subsequently hidden, the table ordering switches back > >to the default ordering for the table. However, the table headings > >don't update to reflect the new ordering. This is because the > >code which sets the heading weight and hides/shows the caret symbols > >only runs when the table is first loaded. > > > >Remove the guard variable which prevents the table chrome from being > >set when the table is updated. This resets formatting of the column > >headings so that the correct heading is highlighted for the ordering > >which is being used. > > > >[YOCTO #9011] > > So, tested this across Toaster (if a table is not on the list, it means > the bug doesn't apply because either only one column is sortable, or > because none of the sortable columns can be hidden using the 'edit > columns' menu). > > It seems to work in all the tables implemented with ToasterTable > > * Image recipes > * Image recipe details (packages included) > * Custom image recipe details (add | remove packages) > * Software recipes > * Machines > * Layers > * All builds > * Project builds > > If the scope of the patch is only tables implemented with ToasterTable, > then this is good to go. For the sake of completion, this is working in > the following tables *not* implemented with ToasterTable > > > > * Recipes > * Packages > > It doesn't seem to work in the following tables *not* implemented with > ToasterTable > > * Packages included > * Tasks (and by extension Time, CPU time and disk I/O since they are the > same as the tasks table). > > Thanks! > > Belén > > > > >Signed-off-by: Elliot Smith <elliot.smith@intel.com> > >--- > > bitbake/lib/toaster/toastergui/static/js/table.js | 6 ------ > > 1 file changed, 6 deletions(-) > > > >diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js > >b/bitbake/lib/toaster/toastergui/static/js/table.js > >index a7e4fba..c8dcd26 100644 > >--- a/bitbake/lib/toaster/toastergui/static/js/table.js > >+++ b/bitbake/lib/toaster/toastergui/static/js/table.js > >@@ -6,7 +6,6 @@ function tableInit(ctx){ > > throw "No url supplied for retreiving data"; > > } > > > >- var tableChromeDone = false; > > var tableTotal = 0; > > > > var tableParams = { > >@@ -178,9 +177,6 @@ function tableInit(ctx){ > > } > > > > function setupTableChrome(tableData){ > >- if (tableChromeDone === true) > >- return; > >- > > var tableHeadRow = table.find("thead"); > > var editColMenu = $("#table-chrome-"+ctx.tableName).find(".editcol"); > > > >@@ -279,8 +275,6 @@ function tableInit(ctx){ > > > > editColMenu.append(toggler); > > } /* End for each column */ > >- > >- tableChromeDone = true; > > } > > > > /* Toggles the active state of the filter button */ > >-- > >1.9.3 > > > >--------------------------------------------------------------------- > >Intel Corporation (UK) Limited > >Registered No. 1134945 (England) > >Registered Office: Pipers Way, Swindon SN3 1RJ > >VAT No: 860 2173 47 > > > >This e-mail and any attachments may contain confidential material for > >the sole use of the intended recipient(s). Any review or distribution > >by others is strictly prohibited. If you are not the intended > >recipient, please contact the sender and delete all copies. > > > >-- > >_______________________________________________ > >toaster mailing list > >toaster@yoctoproject.org > >https://lists.yoctoproject.org/listinfo/toaster > > -- Elliot Smith Software Engineer Intel Open Source Technology Centre [-- Attachment #2: Type: text/html, Size: 5480 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] toaster: ensure ToasterTable chrome is redrawn when ordering changes 2016-03-23 10:49 ` Smith, Elliot @ 2016-03-23 10:57 ` Barros Pena, Belen 2016-03-23 11:54 ` Michael Wood 0 siblings, 1 reply; 5+ messages in thread From: Barros Pena, Belen @ 2016-03-23 10:57 UTC (permalink / raw) To: Smith, Elliot; +Cc: toaster@yoctoproject.org On 23/03/2016 10:49, "Smith, Elliot" <elliot.smith@intel.com> wrote: >I think I should probably fix those tables, too, even though they're not >ToasterTables. Especially since you took the time to test all of them. Up to you really. Not to concerned about it, to be honest, although it would be nice :) Thanks! Belén > > >Elliot > > >On 23 March 2016 at 10:40, Barros Pena, Belen ><belen.barros.pena@intel.com> wrote: > > > >On 21/03/2016 16:16, "toaster-bounces@yoctoproject.org on behalf of Elliot >Smith" <toaster-bounces@yoctoproject.org on behalf of >elliot.smith@intel.com> wrote: > >>If a ToasterTable is ordered by an optional column and that >>column is subsequently hidden, the table ordering switches back >>to the default ordering for the table. However, the table headings >>don't update to reflect the new ordering. This is because the >>code which sets the heading weight and hides/shows the caret symbols >>only runs when the table is first loaded. >> >>Remove the guard variable which prevents the table chrome from being >>set when the table is updated. This resets formatting of the column >>headings so that the correct heading is highlighted for the ordering >>which is being used. >> >>[YOCTO #9011] > >So, tested this across Toaster (if a table is not on the list, it means >the bug doesn't apply because either only one column is sortable, or >because none of the sortable columns can be hidden using the 'edit >columns' menu). > >It seems to work in all the tables implemented with ToasterTable > >* Image recipes >* Image recipe details (packages included) >* Custom image recipe details (add | remove packages) >* Software recipes >* Machines >* Layers >* All builds >* Project builds > >If the scope of the patch is only tables implemented with ToasterTable, >then this is good to go. For the sake of completion, this is working in >the following tables *not* implemented with ToasterTable > > > >* Recipes >* Packages > >It doesn't seem to work in the following tables *not* implemented with >ToasterTable > >* Packages included >* Tasks (and by extension Time, CPU time and disk I/O since they are the >same as the tasks table). > >Thanks! > >Belén > >> >>Signed-off-by: Elliot Smith <elliot.smith@intel.com> >>--- >> bitbake/lib/toaster/toastergui/static/js/table.js | 6 ------ >> 1 file changed, 6 deletions(-) >> >>diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js >>b/bitbake/lib/toaster/toastergui/static/js/table.js >>index a7e4fba..c8dcd26 100644 >>--- a/bitbake/lib/toaster/toastergui/static/js/table.js >>+++ b/bitbake/lib/toaster/toastergui/static/js/table.js >>@@ -6,7 +6,6 @@ function tableInit(ctx){ >> throw "No url supplied for retreiving data"; >> } >> >>- var tableChromeDone = false; >> var tableTotal = 0; >> >> var tableParams = { >>@@ -178,9 +177,6 @@ function tableInit(ctx){ >> } >> >> function setupTableChrome(tableData){ >>- if (tableChromeDone === true) >>- return; >>- >> var tableHeadRow = table.find("thead"); >> var editColMenu = >>$("#table-chrome-"+ctx.tableName).find(".editcol"); >> >>@@ -279,8 +275,6 @@ function tableInit(ctx){ >> >> editColMenu.append(toggler); >> } /* End for each column */ >>- >>- tableChromeDone = true; >> } >> >> /* Toggles the active state of the filter button */ >>-- >>1.9.3 >> >>--------------------------------------------------------------------- >>Intel Corporation (UK) Limited >>Registered No. 1134945 (England) >>Registered Office: Pipers Way, Swindon SN3 1RJ >>VAT No: 860 2173 47 >> >>This e-mail and any attachments may contain confidential material for >>the sole use of the intended recipient(s). Any review or distribution >>by others is strictly prohibited. If you are not the intended >>recipient, please contact the sender and delete all copies. >> > > >>-- >>_______________________________________________ >>toaster mailing list >>toaster@yoctoproject.org >>https://lists.yoctoproject.org/listinfo/toaster > > > > > > > > >-- >Elliot Smith >Software Engineer >Intel Open Source Technology Centre > > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] toaster: ensure ToasterTable chrome is redrawn when ordering changes 2016-03-23 10:57 ` Barros Pena, Belen @ 2016-03-23 11:54 ` Michael Wood 0 siblings, 0 replies; 5+ messages in thread From: Michael Wood @ 2016-03-23 11:54 UTC (permalink / raw) To: toaster I'd rather you didn't remove the chrome redraw optimisation, that saves redrawing the chrome on lots of other table operations. Just storing the default order by would be sufficient: diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/to index a7e4fba..e9c5225 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/lib/toaster/toastergui/static/js/table.js @@ -232,6 +232,10 @@ function tableInit(ctx){ } } + if (col.field_name === tableData.default_orderby){ + title.addClass("default-orderby"); + } + } else { /* Not orderable */ header.css("font-weight", "normal"); @@ -377,7 +381,7 @@ function tableInit(ctx){ if (col === tableParams.orderby || '-' + col === tableParams.orderby){ tableParams.orderby = null; - loadData(tableParams); + $("#"+ctx.tableName +" .default-orderby").click(); } } Michael On 23/03/16 10:57, Barros Pena, Belen wrote: > > On 23/03/2016 10:49, "Smith, Elliot" <elliot.smith@intel.com> wrote: > >> I think I should probably fix those tables, too, even though they're not >> ToasterTables. Especially since you took the time to test all of them. > Up to you really. Not to concerned about it, to be honest, although it > would be nice :) > > Thanks! > > Belén > >> >> Elliot >> >> >> On 23 March 2016 at 10:40, Barros Pena, Belen >> <belen.barros.pena@intel.com> wrote: >> >> >> >> On 21/03/2016 16:16, "toaster-bounces@yoctoproject.org on behalf of Elliot >> Smith" <toaster-bounces@yoctoproject.org on behalf of >> elliot.smith@intel.com> wrote: >> >>> If a ToasterTable is ordered by an optional column and that >>> column is subsequently hidden, the table ordering switches back >>> to the default ordering for the table. However, the table headings >>> don't update to reflect the new ordering. This is because the >>> code which sets the heading weight and hides/shows the caret symbols >>> only runs when the table is first loaded. >>> >>> Remove the guard variable which prevents the table chrome from being >>> set when the table is updated. This resets formatting of the column >>> headings so that the correct heading is highlighted for the ordering >>> which is being used. >>> >>> [YOCTO #9011] >> So, tested this across Toaster (if a table is not on the list, it means >> the bug doesn't apply because either only one column is sortable, or >> because none of the sortable columns can be hidden using the 'edit >> columns' menu). >> >> It seems to work in all the tables implemented with ToasterTable >> >> * Image recipes >> * Image recipe details (packages included) >> * Custom image recipe details (add | remove packages) >> * Software recipes >> * Machines >> * Layers >> * All builds >> * Project builds >> >> If the scope of the patch is only tables implemented with ToasterTable, >> then this is good to go. For the sake of completion, this is working in >> the following tables *not* implemented with ToasterTable >> >> >> >> * Recipes >> * Packages >> >> It doesn't seem to work in the following tables *not* implemented with >> ToasterTable >> >> * Packages included >> * Tasks (and by extension Time, CPU time and disk I/O since they are the >> same as the tasks table). >> >> Thanks! >> >> Belén >> >>> Signed-off-by: Elliot Smith <elliot.smith@intel.com> >>> --- >>> bitbake/lib/toaster/toastergui/static/js/table.js | 6 ------ >>> 1 file changed, 6 deletions(-) >>> >>> diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js >>> b/bitbake/lib/toaster/toastergui/static/js/table.js >>> index a7e4fba..c8dcd26 100644 >>> --- a/bitbake/lib/toaster/toastergui/static/js/table.js >>> +++ b/bitbake/lib/toaster/toastergui/static/js/table.js >>> @@ -6,7 +6,6 @@ function tableInit(ctx){ >>> throw "No url supplied for retreiving data"; >>> } >>> >>> - var tableChromeDone = false; >>> var tableTotal = 0; >>> >>> var tableParams = { >>> @@ -178,9 +177,6 @@ function tableInit(ctx){ >>> } >>> >>> function setupTableChrome(tableData){ >>> - if (tableChromeDone === true) >>> - return; >>> - >>> var tableHeadRow = table.find("thead"); >>> var editColMenu = >>> $("#table-chrome-"+ctx.tableName).find(".editcol"); >>> >>> @@ -279,8 +275,6 @@ function tableInit(ctx){ >>> >>> editColMenu.append(toggler); >>> } /* End for each column */ >>> - >>> - tableChromeDone = true; >>> } >>> >>> /* Toggles the active state of the filter button */ >>> -- >>> 1.9.3 >>> >>> --------------------------------------------------------------------- >>> Intel Corporation (UK) Limited >>> Registered No. 1134945 (England) >>> Registered Office: Pipers Way, Swindon SN3 1RJ >>> VAT No: 860 2173 47 >>> >>> This e-mail and any attachments may contain confidential material for >>> the sole use of the intended recipient(s). Any review or distribution >>> by others is strictly prohibited. If you are not the intended >>> recipient, please contact the sender and delete all copies. >>> >> >>> -- >>> _______________________________________________ >>> toaster mailing list >>> toaster@yoctoproject.org >>> https://lists.yoctoproject.org/listinfo/toaster >> >> >> >> >> >> >> >> -- >> Elliot Smith >> Software Engineer >> Intel Open Source Technology Centre >> >> >> ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-23 11:54 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-21 16:16 [PATCH] toaster: ensure ToasterTable chrome is redrawn when ordering changes Elliot Smith 2016-03-23 10:40 ` Barros Pena, Belen 2016-03-23 10:49 ` Smith, Elliot 2016-03-23 10:57 ` Barros Pena, Belen 2016-03-23 11:54 ` Michael Wood
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.