Destroy Annotator app before storing page into brwoser cache
If we do not destroy annotator app before storing the page at browser cache we will unnecesarily initialize annotations twice (or more) duplicating Annotator HTML markup and causing unexpected errors. Without this commit you will find an error when restoring a page with annotator, you can click on any annotation and you will see the annotation comments are being loaded twice. IMO this is an idempotency issue within Annotator JS library.
This commit is contained in:
@@ -172,6 +172,7 @@ var destroy_non_idempotent_modules = function() {
|
||||
|
||||
App.Datepicker.destroy();
|
||||
App.HTMLEditor.destroy();
|
||||
App.LegislationAnnotatable.destroy();
|
||||
};
|
||||
|
||||
$(document).on("turbolinks:load", initialize_modules);
|
||||
|
||||
Reference in New Issue
Block a user