Commit 43057f5b authored by Jean Michel Rouly's avatar Jean Michel Rouly

Only hook up trigger if it's marked with an annotation.

parent af928110
......@@ -36,18 +36,27 @@ function getAnnotations( field ) {
annotations,
function( index, annotation ) {
// Set the alt description of the trigger element.
$( annotation.id ).attr('alt', annotation.string);
// Define the popover for this annotation.
$( annotation.id ).popover({
toggle: "popover",
trigger: "click",
placement: "auto",
title: annotation.title,
content: annotation.string
});
// Identify the trigger element.
var trigger = $( annotation.id );
// Only enable popover if it's marked as an annotation.
if( trigger.attr('rel') === "annotation" ) {
// Set the alt description of the trigger element.
trigger.attr('alt', annotation.string);
// Define the popover for this annotation.
trigger.popover({
toggle: "popover",
trigger: "click",
placement: "auto",
title: annotation.title,
content: annotation.string
});
}
}
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment