diff --git a/static/js/annotationPanel.js b/static/js/annotationPanel.js index f0cf0e5..e9fee31 100644 --- a/static/js/annotationPanel.js +++ b/static/js/annotationPanel.js @@ -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') { diff --git a/static/js/viewer.js b/static/js/viewer.js index 24c48a2..616aacf 100644 --- a/static/js/viewer.js +++ b/static/js/viewer.js @@ -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();