guillaumepotier / Garlic.js

Automatically persist your forms' text and select field values locally, until the form is submitted.

Home Page:http://garlicjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

oppianmatt opened this issue · comments

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.