Skip to content

RequireJS Support and Misc Improvements#9

Open
mjhasbach wants to merge 4 commits intomezzoblue:masterfrom
mjhasbach:master
Open

RequireJS Support and Misc Improvements#9
mjhasbach wants to merge 4 commits intomezzoblue:masterfrom
mjhasbach:master

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