From 8a4bf48bc6ff433bb725abca6cbb0b70a9a31434 Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Sun, 13 Apr 2014 17:05:41 -0400 Subject: [PATCH] Tweak where Annotator is applied --- karmaworld/assets/js/note-detail.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/karmaworld/assets/js/note-detail.js b/karmaworld/assets/js/note-detail.js index 263811a..d340b76 100644 --- a/karmaworld/assets/js/note-detail.js +++ b/karmaworld/assets/js/note-detail.js @@ -236,8 +236,13 @@ $(function() { injectRemoteScript(setup_ajax_url, noteframe); injectRemoteScript(annotator_js_url, noteframe, function() { - var js = "$(function() { $('#page-container').annotator(); \ - $('#page-container').annotator('addPlugin', 'Store', { \ + var js = "$(function() { \ + var document_selector = $('body'); \ + if ($('#page-container').length > 0) { \ + document_selector = $('#page-container'); \ + } \ + document_selector.annotator(); \ + document_selector.annotator('addPlugin', 'Store', { \ prefix: '/ajax/annotations', \ loadFromSearch: { \ 'uri': " + note_id + " \ -- 2.25.1