add renderAnnotation method

This commit is contained in:
rlx 2019-02-04 14:23:42 +05:30
commit ef2b56e0a9
4 changed files with 30 additions and 19 deletions

View file

@ -23,14 +23,14 @@ oml.ui.annotationPanel = function() {
{id: 'addAnnotation', title: 'Add Annotation', disabled: true},
{id: 'removeAnnotation', title: 'Remove Annotation', disabled: true},
{},
{id: 'showAnnotationUsers', title: Ox._('Show Annotations'), disabled: true},
{group: 'show', min: 1, max: 1, items: [
{id: 'show', title: Ox._('Show Annotations'), disabled: true},
{group: 'showAnnotationUsers', min: 1, max: 1, items: [
{id: 'all', title: Ox._('All Annotations'), checked: ui.showAnnotationUsers == 'all'},
{id: 'me', title: Ox._('My Annotations'), checked: ui.showAnnotationUsers == 'me'},
]},
{},
{id: 'sortAnnotations', title: Ox._('Sort Annotations'), disabled: true},
{group: 'sort', min: 1, max: 1, items: [
{id: 'sort', title: Ox._('Sort Annotations'), disabled: true},
{group: 'sortAnnotations', min: 1, max: 1, items: [
{id: 'position', title: Ox._('By Position'), checked: ui.sortAnnotations == 'position'},
{id: 'quote', title: Ox._('By Quote Text'), checked: ui.sortAnnotations == 'quote'},
{id: 'note', title: Ox._('By Note Text'), checked: ui.sortAnnotations == 'note'},
@ -46,8 +46,18 @@ oml.ui.annotationPanel = function() {
}).css({
// borderColor: 'transparent',
float: 'right'
}).appendTo($bar)
.bindEvent({
}).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') {
@ -59,7 +69,7 @@ oml.ui.annotationPanel = function() {
})
}
}
});
}).appendTo($bar);
var ui = oml.user.ui;
var that = Ox.SplitPanel({