[annotator-dev] Hide annotator and reload annotations

Steph Skardal steph at endpoint.com
Fri Feb 14 15:01:30 UTC 2014


On 02/13/2014 06:03 PM, Randall Leeds wrote:
> On Thu, Feb 13, 2014 at 8:56 AM, Steph Skardal <steph at endpoint.com 
> <mailto:steph at endpoint.com>> wrote:
>
>     On 02/13/2014 11:44 AM, Riccardo Tasso wrote:
>
>         I don't know how to invoke it :)
>
>
>     Hmm, I invoked annotator functionality inside my plugin. Do you
>     have a plugin set up? If you set up a plugin based on the
>     documentation, in the scope of a plugin, "this" is the plugin and
>     "this.annotator" is the annotator object, and I think you could
>     invoke via this.annotator.destroy(). Your plugin could contain the
>     on & off toggle and you could access the annotator in those methods.
>
>
> Destroying the annotator from a plugin is a bit strange, but maybe not 
> totally ridiculous. The reason I say it's a bit strange is because 
> calling it will also invoke a destroy method on your plugin. If all is 
> implemented as it should be, your plugin shouldn't be around to toggle 
> the annotator back on.
>
> I would ask how you're constructing the annotator to begin with. Are 
> you invoking the Annotator constructor directly, or using the jquery 
> plugin interface where you call .annotator() on a jquery object?

Ah - good to know Randall. I was just trying to give Riccardo some ideas 
of how I invoked various methods on the annotator object before, b/c I 
was unable to execute these methods through jQuery chaining / a jQuery 
object. I don't use the destroy method in my use case, but I do access 
various Annotator methods in my plugin.

Riccardo made a request that I think would be nice - the destroy() 
method on the jQuery object. I also think it would be nice to be able to 
toggle the readOnly state of the annotator.

Steph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140214/3632ee73/attachment-0004.html>


More information about the annotator-dev mailing list