summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2017-09-03 21:02:23 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-04 17:51:06 +0100
commit17aa1ef8f0a00dd3456aac199e558a2f96bf7ad9 (patch)
tree253a9dc21bc986a3c2f5887545d2a2aed74df07f
parent2ff5592baf011de9c778d3c2481b8ed3912f1a4b (diff)
downloadbitbake-contrib-17aa1ef8f0a00dd3456aac199e558a2f96bf7ad9.tar.gz
toaster: edit column list not sorted
The list of columns in the many 'Edit Columns' pop-ups became unsorted with the 'Toaster Table' implementation. These entries need to be gathered and sorted in the column processing. [YOCTO #12004] Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/toaster/toastergui/static/js/table.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/toaster/toastergui/static/js/table.js b/lib/toaster/toastergui/static/js/table.js
index 1bbc8d1b5..abcb5ca7a 100644
--- a/lib/toaster/toastergui/static/js/table.js
+++ b/lib/toaster/toastergui/static/js/table.js
@@ -202,6 +202,7 @@ function tableInit(ctx){
}
/* Add table header and column toggle menu */
+ var column_edit_entries = [];
for (var i in tableData.columns){
var col = tableData.columns[i];
if (col.displayable === false) {
@@ -293,9 +294,17 @@ function tableInit(ctx){
defaultHiddenCols.push(col.field_name);
}
- editColMenu.append(toggler);
+ /* Gather the Edit Column entries */
+ column_edit_entries.push({'title':col.title,'html':toggler});
+
} /* End for each column */
+ /* Append the sorted Edit Column toggler entries */
+ column_edit_entries.sort(function(a,b) {return (a.title > b.title) ? 1 : ((b.title > a.title) ? -1 : 0);} );
+ for (var col in column_edit_entries){
+ editColMenu.append(column_edit_entries[col].html);
+ }
+
tableChromeDone = true;
}