-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make template options to be complied jquery object
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8007213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I don't know if this is something I'm doing wrong or not as I don't really understand the reasoning behind this change but jQuery isn't defined in my project here. I'm having to use the previous version.
8007213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just allows
options.template
to override the default template if that variable contains a string, or a jQuery object. It should have no impact on your project. jQuery is a prerequisite for the library overall, has been for 4 years.8007213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a commonjs environment, jQuery will not be defined, which is probably what Borginator is running into. Instead the defined variable $ should be used.
This happens because commonjs will not allow jQuery to pollute the global namespace, so the global jQuery object is not available and only the $ passed into the function is.
8007213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added another check
if typeof jQuery !== 'undefined'
here before checking if the template is an instance of jQuery8007213
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I wrote, if you replace the use of the undefined variable
jQuery
by the parameter$
of the function this code is in (see line 35), it will work.