From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 28 Dec 2020 08:20:55 +0000 (-0800) Subject: Update spelling of cancellable (#8236) X-Git-Tag: v3.0.0-beta.8~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6dfc47927508c79aa5495be65e8bda32fffddcf;p=thirdparty%2FChart.js.git Update spelling of cancellable (#8236) --- diff --git a/src/core/core.controller.js b/src/core/core.controller.js index ee0e9df94..813ae3586 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -462,7 +462,7 @@ class Chart { // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167 me._plugins.invalidate(); - if (me.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) { + if (me.notifyPlugins('beforeUpdate', {mode, cancellable: true}) === false) { return; } @@ -504,7 +504,7 @@ class Chart { _updateLayout() { const me = this; - if (me.notifyPlugins('beforeLayout', {cancelable: true}) === false) { + if (me.notifyPlugins('beforeLayout', {cancellable: true}) === false) { return; } @@ -544,7 +544,7 @@ class Chart { const me = this; const isFunction = typeof mode === 'function'; - if (me.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) { + if (me.notifyPlugins('beforeDatasetsUpdate', {mode, cancellable: true}) === false) { return; } @@ -563,7 +563,7 @@ class Chart { _updateDataset(index, mode) { const me = this; const meta = me.getDatasetMeta(index); - const args = {meta, index, mode, cancelable: true}; + const args = {meta, index, mode, cancellable: true}; if (me.notifyPlugins('beforeDatasetUpdate', args) === false) { return; @@ -571,13 +571,13 @@ class Chart { meta.controller._update(mode); - args.cancelable = false; + args.cancellable = false; me.notifyPlugins('afterDatasetUpdate', args); } render() { const me = this; - if (me.notifyPlugins('beforeRender', {cancelable: true}) === false) { + if (me.notifyPlugins('beforeRender', {cancellable: true}) === false) { return; } @@ -605,7 +605,7 @@ class Chart { return; } - if (me.notifyPlugins('beforeDraw', {cancelable: true}) === false) { + if (me.notifyPlugins('beforeDraw', {cancellable: true}) === false) { return; } @@ -662,7 +662,7 @@ class Chart { _drawDatasets() { const me = this; - if (me.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) { + if (me.notifyPlugins('beforeDatasetsDraw', {cancellable: true}) === false) { return; } @@ -687,7 +687,7 @@ class Chart { const args = { meta, index: meta.index, - cancelable: true + cancellable: true }; if (me.notifyPlugins('beforeDatasetDraw', args) === false) { @@ -705,7 +705,7 @@ class Chart { unclipArea(ctx); - args.cancelable = false; + args.cancellable = false; me.notifyPlugins('afterDatasetDraw', args); } @@ -1020,7 +1020,7 @@ class Chart { */ _eventHandler(e, replay) { const me = this; - const args = {event: e, replay, cancelable: true}; + const args = {event: e, replay, cancellable: true}; if (me.notifyPlugins('beforeEvent', args) === false) { return; @@ -1028,7 +1028,7 @@ class Chart { const changed = me._handleEvent(e, replay); - args.cancelable = false; + args.cancellable = false; me.notifyPlugins('afterEvent', args); if (changed) { diff --git a/src/core/core.plugins.js b/src/core/core.plugins.js index 5ebd25fa0..ad8abf1b0 100644 --- a/src/core/core.plugins.js +++ b/src/core/core.plugins.js @@ -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.cancelable) { + if (callCallback(method, params, plugin) === false && args.cancellable) { return false; } } diff --git a/test/specs/core.plugin.tests.js b/test/specs/core.plugin.tests.js index af93dc53a..f794690c1 100644 --- a/test/specs/core.plugin.tests.js +++ b/test/specs/core.plugin.tests.js @@ -151,7 +151,7 @@ describe('Chart.plugins', function() { spyOn(plugin, 'hook').and.callThrough(); }); - var ret = chart.notifyPlugins('hook', {cancelable: true}); + var ret = chart.notifyPlugins('hook', {cancellable: true}); expect(ret).toBeFalsy(); expect(plugins[0].hook).toHaveBeenCalled(); expect(plugins[1].hook).toHaveBeenCalled();