Skip to content
Snippets Groups Projects
Commit 195709ec authored by David Hoksza's avatar David Hoksza
Browse files

sorting of annotations within annotator group in left panel

parent 2d1c00a6
No related branches found
No related tags found
1 merge request!201Cellwall annotations
...@@ -106,8 +106,7 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { ...@@ -106,8 +106,7 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) {
var paramsDefs = annotator.getParametersDefinitions(); var paramsDefs = annotator.getParametersDefinitions();
if (paramsDefs.length > 0) { if (paramsDefs.length > 0) {
console.log('annotator', annotator);
annotatorsParams.appendChild(Functions.createElement({ annotatorsParams.appendChild(Functions.createElement({
type: "div", type: "div",
className: "minerva-annotators-params-header", className: "minerva-annotators-params-header",
...@@ -139,7 +138,6 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { ...@@ -139,7 +138,6 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) {
content: param.name content: param.name
}); });
console.log('param', param);
var toolTip = Functions.createElement({ var toolTip = Functions.createElement({
type: "span", type: "span",
className: "annotator-tooltip", className: "annotator-tooltip",
...@@ -156,8 +154,6 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { ...@@ -156,8 +154,6 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) {
existingParamValue = existingAnnotatorsParameters[annotator.getClassName()][param.name] existingParamValue = existingAnnotatorsParameters[annotator.getClassName()][param.name]
} }
console.log('existingParamValue', existingParamValue);
if (param.type.indexOf("String") >= 0) { if (param.type.indexOf("String") >= 0) {
paramValue = Functions.createElement({ paramValue = Functions.createElement({
type: "textarea", type: "textarea",
......
...@@ -209,6 +209,14 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) { ...@@ -209,6 +209,14 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) {
groupContainer.appendChild(par); 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++) { for (var j = 0; j < grouppedAnnotations[desc].length; j++) {
cntAnnotations += 1; cntAnnotations += 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment