]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Platform event API abstraction
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Sat, 14 Jan 2017 13:38:56 +0000 (14:38 +0100)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sun, 15 Jan 2017 19:25:38 +0000 (14:25 -0500)
commit312773ba7b7e2acf6cd1273c92017d3c197a992b
treef5b5338f2a8bee6d6fdabfc0ea5babab85d2dc08
parent9e9b9cf46d452dfbfb2fa19a9cd362d4405abfdc
Platform event API abstraction

Move base platform definition and logic in src/platform/platform.js and simplify the browser -> Chart.js event mapping by listing only different naming then fallback to the native type.

Replace `createEvent` by `add/removeEventListener` methods which dispatch Chart.js IEvent objects instead of native events. Move `add/removeResizeListener` implementation into the DOM platform which is now accessible via `platform.add/removeEventListener(chart, 'resize', listener)`.

Finally, remove `bindEvent` and `unbindEvent` from the helpers since the implementation is specific to the chart controller (and should be private).
src/chart.js
src/core/core.controller.js
src/core/core.helpers.js
src/core/core.interaction.js
src/core/core.legend.js
src/core/core.tooltip.js
src/platforms/platform.dom.js
src/platforms/platform.js [new file with mode: 0644]
test/platform.dom.tests.js