Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library: Document that, when using requirejs, a page should only be instantiated after the whole library is loaded, otherwise it may fail to instantiate some widgets #339

Open
gabrielschulhof opened this issue Oct 14, 2014 · 0 comments
Assignees
Milestone

Comments

@gabrielschulhof
Copy link

We need to provide an example of a scenario where somebody uses the library using requirejs, and maybe skips init altogether. For example,

require([
    "jqm/widgets/popup",
    "jqm/widgets/listview",
    "jqm/widgets/page" ], function() {

    $( function() {
        $( "#start-page" ).page();
    });
};

Will not work if requirejs loads page after it has loaded popup and listview. We need to document that, in 1.4.x, one needs to require page before requiring any of the widgets:

require([
    "jqm/widgets/page" ], function() {

    require([
        "jqm/widgets/popup",
        "jqm/widgets/listview" ] ,function() {

        $( function() {
            $( "#start-page" ).page();
        });
    });
});
@gabrielschulhof gabrielschulhof self-assigned this Oct 14, 2014
@gabrielschulhof gabrielschulhof added this to the 1.4 milestone Oct 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant