Mercurial > hg > digilib-old
comparison webapp/src/main/webapp/jquery/jquery.digilib.annotations.js @ 1097:ebdde1bbb026
annotation show/hide works now.
author | robcast |
---|---|
date | Wed, 24 Oct 2012 18:05:47 +0200 |
parents | 782593171adb |
children | c5ed20cd24ae |
comparison
equal
deleted
inserted
replaced
1096:3c75dda660bf | 1097:ebdde1bbb026 |
---|---|
47 * show/hide annotations | 47 * show/hide annotations |
48 */ | 48 */ |
49 toggleAnnotations : function(data) { | 49 toggleAnnotations : function(data) { |
50 var show = !data.settings.isAnnotationsVisible; | 50 var show = !data.settings.isAnnotationsVisible; |
51 data.settings.isAnnotationsVisible = show; | 51 data.settings.isAnnotationsVisible = show; |
52 fn.highlightButtons(data, 'annotations', show); | 52 digilib.fn.highlightButtons(data, 'annotations', show); |
53 renderAnnotations(data); | 53 renderAnnotations(data); |
54 }, | 54 }, |
55 | 55 |
56 /** | 56 /** |
57 * set a mark-annotation by clicking (or giving a position and a text) | 57 * set a mark-annotation by clicking (or giving a position and a text) |
132 var $elem = data.$elem; | 132 var $elem = data.$elem; |
133 var annotations = data.annotations; | 133 var annotations = data.annotations; |
134 console.debug("renderAnnotations: annotations=" + annotations); | 134 console.debug("renderAnnotations: annotations=" + annotations); |
135 // clear annotations | 135 // clear annotations |
136 $elem.find('div.' + cssPrefix + 'annotationmark').remove(); | 136 $elem.find('div.' + cssPrefix + 'annotationmark').remove(); |
137 if (!data.settings.isAnnotationsVisible) return; | |
137 for (var i = 0; i < annotations.length; i++) { | 138 for (var i = 0; i < annotations.length; i++) { |
138 var annotation = annotations[i]; | 139 var annotation = annotations[i]; |
139 if (data.zoomArea.containsPosition(annotation.pos)) { | 140 if (data.zoomArea.containsPosition(annotation.pos)) { |
140 var mpos = data.imgTrafo.transform(annotation.pos); | 141 var mpos = data.imgTrafo.transform(annotation.pos); |
141 console.debug("renderannotations: pos=", mpos); | 142 console.debug("renderannotations: pos=", mpos); |