Browse Source

fix annotations sort

master
j 1 year ago
parent
commit
111ea307a9
2 changed files with 9 additions and 16 deletions
  1. +8
    -13
      static/js/annotationPanel.js
  2. +1
    -3
      static/js/viewer.js

+ 8
- 13
static/js/annotationPanel.js View File

@@ -64,17 +64,6 @@ oml.ui.annotationPanel = function(options, self) {
// borderColor: 'transparent',
float: 'right'
}).bindEvent({
change: function(data) {
if (data.id == 'showAnnotationUsers') {
var value = data.checked[0].id;
oml.UI.set('showAnnotationUsers', value);
oml.$ui.viewer.renderAnnotations();
} else if (data.id == 'sortAnnotations') {
var value = data.checked[0].id;
oml.UI.set('sortAnnotations', value);
oml.$ui.viewer.renderAnnotations();
}
},
click: function(data) {
var id = data.id;
if (id == 'exportAnnotations') {
@@ -98,8 +87,14 @@ oml.ui.annotationPanel = function(options, self) {
},
change: function(data) {
var id = data.id;
console.log('change', data)
if (id == 'show') {
if (data.id == 'showAnnotationUsers') {
var value = data.checked[0].id;
oml.UI.set('showAnnotationUsers', value);
oml.$ui.viewer.renderAnnotations();
} else if (data.id == 'sortAnnotations') {
var value = data.checked[0].id;
oml.UI.set('sortAnnotations', value);
} else if (id == 'show') {
console.log('show', data)
oml.UI.set({annotationsShow: data.checked[0].id});
} else if (id == 'sort') {

+ 1
- 3
static/js/viewer.js View File

@@ -206,9 +206,6 @@ oml.ui.viewer = function() {
if (sortKey == 'date') {
sortKey = 'created'
}
if (sortKey == 'date') {
sortKey = 'created'
}
if (sortKey == 'quote') {
sortKey = 'text'
}
@@ -216,6 +213,7 @@ oml.ui.viewer = function() {
loadAnnotations(function() {
that.renderAnnotations()
})
return
}
annotations = Ox.sortBy(annotations, sortKey)
oml.$ui.annotationFolder.empty();

Loading…
Cancel
Save