guillaumepotier / Garlic.js

Automatically persist your forms' text and select field values locally, until the form is submitted.
http://garlicjs.org/
Other
2.36k stars 176 forks source link

data-persist="garlic" doesn't work after window.load event #108

Open oppianmatt opened 7 years ago

oppianmatt commented 7 years ago

Say we load garlic.js after the window.load event has fired. Then the content marked up with data-persist="garlic" doesn't work since:

    b(window).on("load", function() {
        b('[data-persist="garlic"]').each(function() {
            b(this).garlic()
        })
    })

Doesn't fire. It's not like the jquery dom ready event which triggers even if it already ran.