From 828c98a4e8e2745801c6ed6b24b7705e924cd757 Mon Sep 17 00:00:00 2001 From: David Hoksza <david.hoksza@uni.lu> Date: Wed, 7 Feb 2018 16:02:56 +0100 Subject: [PATCH] sorting of annotations within annotator group in left panel --- .../src/main/js/gui/admin/ChooseAnnotatorsDialog.js | 6 +----- frontend-js/src/main/js/gui/leftPanel/GuiUtils.js | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js b/frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js index 8f1d65b6a1..55befeaa79 100644 --- a/frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js +++ b/frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js @@ -104,8 +104,7 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { var paramsDefs = annotator.getParametersDefinitions(); if (paramsDefs.length > 0) { - console.log('annotator', annotator); - + annotatorsParams.appendChild(Functions.createElement({ type: "div", className: "minerva-annotators-params-header", @@ -137,7 +136,6 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { content: param.name }); - console.log('param', param); var toolTip = Functions.createElement({ type: "span", className: "annotator-tooltip", @@ -154,8 +152,6 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { existingParamValue = existingAnnotatorsParameters[annotator.getClassName()][param.name] } - console.log('existingParamValue', existingParamValue); - if (param.type.indexOf("String") >= 0) { paramValue = Functions.createElement({ type: "textarea", diff --git a/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js b/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js index ac49e55221..1ac0e50928 100644 --- a/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js +++ b/frontend-js/src/main/js/gui/leftPanel/GuiUtils.js @@ -209,6 +209,14 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) { groupContainer.appendChild(par); } + grouppedAnnotations[desc] = grouppedAnnotations[desc].sort(function(a, b) { + const aType = a.getType().toUpperCase(); + const bType = b.getType().toUpperCase(); + if (aType < bType) return -1; + else if (aType > bType) return 1; + else return 0; + }); + for (var j = 0; j < grouppedAnnotations[desc].length; j++) { cntAnnotations += 1; -- GitLab