[annotator-dev] Hide annotator and reload annotations

Riccardo Tasso riccardo.tasso at gmail.com
Fri Feb 14 07:11:56 UTC 2014


Having a plugin to turn annotator off is not important for me.
This is how I initialize annotator:

var text = $(this.element).find('.text').first();
text.annotator();
text.annotator('addPlugin', 'MyAnnotatorPlugin');
...

it would be nice having something like this:

$(button).on('click', function() {

   var text = $(this.element).find('.text').first();
   if(text.annotator == undefined) {  // everytime I turn on I reload
annotations
      text.annotator();
      text.annotator('addPlugin', 'MyAnnotatorPlugin');
      ...
   } else {
       text.annotator.destroy();
       // at this point text.annotator is undefined
   }
});

Thanks,
    Riccardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140214/b45dcdc8/attachment-0004.html>


More information about the annotator-dev mailing list