]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Revert "Update spelling of cancellable (#8236)" (#8312)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Sat, 16 Jan 2021 19:14:15 +0000 (11:14 -0800)
committerGitHub <noreply@github.com>
Sat, 16 Jan 2021 19:14:15 +0000 (21:14 +0200)
This reverts commit e6dfc47927508c79aa5495be65e8bda32fffddcf.

src/core/core.controller.js
src/core/core.plugins.js
test/specs/core.plugin.tests.js

index 8fdcda2b4770dcf73b33a09a7f6f093e593d857b..c459fcc60612bab980d79e0480862b1497b4fbe8 100644 (file)
@@ -462,7 +462,7 @@ class Chart {
                // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167
                me._plugins.invalidate();
 
-               if (me.notifyPlugins('beforeUpdate', {mode, cancellable: true}) === false) {
+               if (me.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {
                        return;
                }
 
@@ -508,7 +508,7 @@ class Chart {
        _updateLayout() {
                const me = this;
 
-               if (me.notifyPlugins('beforeLayout', {cancellable: true}) === false) {
+               if (me.notifyPlugins('beforeLayout', {cancelable: true}) === false) {
                        return;
                }
 
@@ -548,7 +548,7 @@ class Chart {
                const me = this;
                const isFunction = typeof mode === 'function';
 
-               if (me.notifyPlugins('beforeDatasetsUpdate', {mode, cancellable: true}) === false) {
+               if (me.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {
                        return;
                }
 
@@ -567,7 +567,7 @@ class Chart {
        _updateDataset(index, mode) {
                const me = this;
                const meta = me.getDatasetMeta(index);
-               const args = {meta, index, mode, cancellable: true};
+               const args = {meta, index, mode, cancelable: true};
 
                if (me.notifyPlugins('beforeDatasetUpdate', args) === false) {
                        return;
@@ -575,13 +575,13 @@ class Chart {
 
                meta.controller._update(mode);
 
-               args.cancellable = false;
+               args.cancelable = false;
                me.notifyPlugins('afterDatasetUpdate', args);
        }
 
        render() {
                const me = this;
-               if (me.notifyPlugins('beforeRender', {cancellable: true}) === false) {
+               if (me.notifyPlugins('beforeRender', {cancelable: true}) === false) {
                        return;
                }
 
@@ -609,7 +609,7 @@ class Chart {
                        return;
                }
 
-               if (me.notifyPlugins('beforeDraw', {cancellable: true}) === false) {
+               if (me.notifyPlugins('beforeDraw', {cancelable: true}) === false) {
                        return;
                }
 
@@ -666,7 +666,7 @@ class Chart {
        _drawDatasets() {
                const me = this;
 
-               if (me.notifyPlugins('beforeDatasetsDraw', {cancellable: true}) === false) {
+               if (me.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {
                        return;
                }
 
@@ -691,7 +691,7 @@ class Chart {
                const args = {
                        meta,
                        index: meta.index,
-                       cancellable: true
+                       cancelable: true
                };
 
                if (me.notifyPlugins('beforeDatasetDraw', args) === false) {
@@ -709,7 +709,7 @@ class Chart {
 
                unclipArea(ctx);
 
-               args.cancellable = false;
+               args.cancelable = false;
                me.notifyPlugins('afterDatasetDraw', args);
        }
 
@@ -1024,7 +1024,7 @@ class Chart {
         */
        _eventHandler(e, replay) {
                const me = this;
-               const args = {event: e, replay, cancellable: true};
+               const args = {event: e, replay, cancelable: true};
 
                if (me.notifyPlugins('beforeEvent', args) === false) {
                        return;
@@ -1032,7 +1032,7 @@ class Chart {
 
                const changed = me._handleEvent(e, replay);
 
-               args.cancellable = false;
+               args.cancelable = false;
                me.notifyPlugins('afterEvent', args);
 
                if (changed || args.changed) {
index ad8abf1b0bd5fcff70b67f3133cf6faac1ab0813..5ebd25fa0435b831ec1cf71cfa5b9b18ba0e92e1 100644 (file)
@@ -50,7 +50,7 @@ export default class PluginService {
                        const plugin = descriptor.plugin;
                        const method = plugin[hook];
                        const params = [chart, args, descriptor.options];
-                       if (callCallback(method, params, plugin) === false && args.cancellable) {
+                       if (callCallback(method, params, plugin) === false && args.cancelable) {
                                return false;
                        }
                }
index f794690c14a6f6f52d86b6cc1157565ef0530868..af93dc53af3f5b237c84729b25a7d811c7ebe897 100644 (file)
@@ -151,7 +151,7 @@ describe('Chart.plugins', function() {
                                spyOn(plugin, 'hook').and.callThrough();
                        });
 
-                       var ret = chart.notifyPlugins('hook', {cancellable: true});
+                       var ret = chart.notifyPlugins('hook', {cancelable: true});
                        expect(ret).toBeFalsy();
                        expect(plugins[0].hook).toHaveBeenCalled();
                        expect(plugins[1].hook).toHaveBeenCalled();