Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.
This repository was archived by the owner on Jul 29, 2022. It is now read-only.

Error using plugin with Drupal 8  #205

@francesco-pesenti

Description

@francesco-pesenti

Hi, I'm using this great lib in a Drupal 8 project; all works fine except when I'm using a plugin (eg. datepicker).
Since Drupal uses jQuery in a no-conflict mode other scripts need to be wrapped with:

(function($) {
})(jQuery);

From official documentation (https://www.drupal.org/docs/8/api/javascript-api/javascript-api-overview):

Note: Since Drupal uses jQuery.noConflict() and only loads JavaScript files when required, to use jQuery and the $ shortcode for jQuery you must include jQuery and Drupal as dependencies in the library definition in your MODULE.libraries.yml and add a wrapper around your function.

I saw you wrap the main script but not the plugins. Are there some issues on do this?
If no and you agree I can made a patch.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions