From 5f5ebc3b7a971136b0540023fdbfe5ae5dbca1bf Mon Sep 17 00:00:00 2001 From: rlx Date: Mon, 4 Feb 2019 13:59:34 +0530 Subject: [PATCH] update annotation menu --- static/js/annotationPanel.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/static/js/annotationPanel.js b/static/js/annotationPanel.js index 0ca5c7a..877c648 100644 --- a/static/js/annotationPanel.js +++ b/static/js/annotationPanel.js @@ -2,6 +2,8 @@ oml.ui.annotationPanel = function() { + var ui = oml.user.ui; + var $bar = Ox.Bar({size: 16}); var $button = Ox.Button({ @@ -18,18 +20,21 @@ oml.ui.annotationPanel = function() { var $menuButton = Ox.MenuButton({ items: [ - {id: 'showAnnotations', title: Ox._('Show Annotations'), disabled: true}, - {group: 'sort', min: 1, max: 1, items: [ - {id: 'all', title: Ox._('All Annotations'), checked: true}, - {id: 'my', title: Ox._('My Annotations'), checked: false}, + {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: '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: 'position', title: Ox._('By Position'), checked: true}, - {id: 'quote', title: Ox._('By Quote Text'), checked: false}, - {id: 'note', title: Ox._('By Note Text'), checked: false}, - {id: 'date', title: Ox._('By Date Added'), checked: false} + {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'}, + {id: 'date', title: Ox._('By Date Added'), checked: ui.sortAnnotations == 'date'} ]}, {}, {id: 'exportAnnotations', title: Ox._('Export Annotations')},