prismicio / prismic-toolbar

An embeddable UI for Prismic content and previews directly on your website.
12 stars 19 forks source link

Better ready state detection #25

Closed AdamPflug closed 6 years ago

AdamPflug commented 6 years ago

In #22 I fixed the shared preview functionality if you injected the script after the onload event fired. This update improves that fix so it also works in the case where DOMContentLoaded has fired, but onload hasn't happened yet. This is now essentially doing the same thing as jQuery's $(document).ready() so it should be more bullet-proof than the previous fix.

AdamPflug commented 6 years ago

Resolved by the changes in #36 (plus some other changes that have happened in the meantime).