Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id B73E3E00CD8; Sun, 3 Sep 2017 13:24:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 38962E00CC4 for ; Sun, 3 Sep 2017 13:24:13 -0700 (PDT) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id v83KODaF030094 (version=TLSv1 cipher=AES128-SHA bits=128 verify=OK) for ; Sun, 3 Sep 2017 13:24:13 -0700 Received: from ala-dreyna-lx3.corp.ad.wrs.com (147.11.157.78) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server (TLS) id 14.3.361.1; Sun, 3 Sep 2017 13:24:12 -0700 From: David Reyna To: Date: Sun, 3 Sep 2017 13:15:54 -0700 Message-ID: <1504469754-11556-1-git-send-email-david.reyna@windriver.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [147.11.157.78] Subject: [PATCH] toaster: edit column list not sorted X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Sep 2017 20:24:14 -0000 Content-Type: text/plain From: David Reyna 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 --- bitbake/lib/toaster/toastergui/static/js/table.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/table.js b/bitbake/lib/toaster/toastergui/static/js/table.js index 1bbc8d1..7e7569b 100644 --- a/bitbake/lib/toaster/toastergui/static/js/table.js +++ b/bitbake/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,12 +294,28 @@ 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 Columns 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; } + function col_compare(a,b) { + if (a.last_nom < b.last_nom) + return -1; + if (a.last_nom > b.last_nom) + return 1; + return 0; + } + /* Toggles the active state of the filter button */ function filterBtnActive(filterBtn, active){ if (active) { -- 1.9.1