Skip to content

AMD Loading with require.js #348

@danhorner

Description

@danhorner

I haven't been able to load the keyboard plugin via AMD. I'm a little new at this but have encountered a couple of issues:

  • There are two define() blocks in jquery.keyboard.js. One for the keyboard and one for the caret plugin. Keyboard has an undeclared dependency on the caret plugin but is first in the source order.
  • Keyboard invokes caret plugin on domReady:
 $( function(){ $keyboard.checkCaretSupport(); });
  • But when loading via AMD, the DOM is ready before keyboard.js loads, so the call is not properly deferred. Changing the order of the two plugins in the source fixes the immediate problem, but the two define()'d modules confuse require.js

Trying to figure out how to postpone dom ready and/or declare the dependency. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions