-
-
Notifications
You must be signed in to change notification settings - Fork 365
fix on plugin wrapper in order to work with webpack #199
Conversation
dist/js/bootstrap-colorpicker.js
Outdated
(function(root, factory) { | ||
if (typeof define === 'function' && define.amd) { | ||
// AMD. Register as an anonymous module unless amdModuleId is set | ||
define(["jquery"], function(a0) { |
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.
what does a0
mean? can you use a more auto-describing variable name?
dist/js/bootstrap-colorpicker.js
Outdated
// only CommonJS-like environments that support module.exports, | ||
// like Node. | ||
module.exports = factory(require("jquery")); | ||
} else { |
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.
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?
dist/js/bootstrap-colorpicker.js
Outdated
} | ||
}(function(jQuery, window) { | ||
'use strict'; |
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.
you also deleted use strict
why?
I will update the pr with the needed changes when I get home. |
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: btw, thank you for providing such a great package ^^ |
thank you! |
#195