Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

fix on plugin wrapper in order to work with webpack #199

Merged
merged 3 commits into from
Feb 1, 2017
Merged

fix on plugin wrapper in order to work with webpack #199

merged 3 commits into from
Feb 1, 2017

Conversation

n1crack
Copy link
Contributor

@n1crack n1crack commented Jan 29, 2017

(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define(["jquery"], function(a0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does a0 mean? can you use a more auto-describing variable name?

// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"));
} else {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you delete this part of the condition else if (!jQuery.fn.colorpicker) ?
it avoids re-executing the factory if the colorpicker plugin is already loaded.
can you restore this condition?

}
}(function(jQuery, window) {
'use strict';
Copy link
Owner

@itsjavi itsjavi Jan 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also deleted use strict why?

@n1crack
Copy link
Contributor Author

n1crack commented Jan 30, 2017

I will update the pr with the needed changes when I get home.

@n1crack
Copy link
Contributor Author

n1crack commented Jan 30, 2017

made the changes. You can reject it, if the global variable is a must.

I am using my own branch that works for me. In my package.json:
"bootstrap-colorpicker": "git://github.com/n1crack/bootstrap-colorpicker.git#master",

btw, thank you for providing such a great package ^^

@itsjavi itsjavi merged commit ed42bce into itsjavi:master Feb 1, 2017
@itsjavi
Copy link
Owner

itsjavi commented Feb 1, 2017

thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants