]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toaster: edit column list not sorted
authorDavid Reyna <David.Reyna@windriver.com>
Mon, 4 Sep 2017 04:02:23 +0000 (21:02 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Sep 2017 14:00:49 +0000 (15:00 +0100)
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]

(Bitbake rev: 17aa1ef8f0a00dd3456aac199e558a2f96bf7ad9)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/toaster/toastergui/static/js/table.js

index 1bbc8d1b5ae396a657a0e63854595bf9c207c8e8..abcb5ca7a0eadd87421fe8623562e9df4676a2dc 100644 (file)
@@ -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;
   }