Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequireJS Support and Misc Improvements #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mjhasbach
Copy link

  • Use common.js and paintbrush.js from the root of the repo for the demo
    • Less files to maintain
  • Added RequireJS support
  • The API is now an object of methods
    • Necessary for compatibility with RequireJS. CommonJS support can now also be easily added in the future.
  • Removed unused function normalizeMatrix
  • Don't automatically process filters on page load
    • That was interfering with RequireJS support. Another possibility is creating an init method on the paintBrush object which calls addLoadEvent and executes paintBrush.processFilters in the callback. In my opinion, the developers who leverage this library should be able to decide when filters are processed.

If you like this PR, I will write some documentation on how to configure PaintbrushJS as a RequireJS package.

@yannicklamprecht
Copy link

Love that last point. I hope that I'm now able to update certain DOM-Elements without recoloring the others.

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

Successfully merging this pull request may close these issues.

2 participants