Skip to content

Commit

Permalink
Revert "Update spelling of cancellable (#8236)" (#8312)
Browse files Browse the repository at this point in the history
This reverts commit e6dfc47.
  • Loading branch information
benmccann committed Jan 16, 2021
1 parent 32b3242 commit 00dbe71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions src/core/core.controller.js
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -567,21 +567,21 @@ 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;
}

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;
}

Expand Down Expand Up @@ -609,7 +609,7 @@ class Chart {
return;
}

if (me.notifyPlugins('beforeDraw', {cancellable: true}) === false) {
if (me.notifyPlugins('beforeDraw', {cancelable: true}) === false) {
return;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -691,7 +691,7 @@ class Chart {
const args = {
meta,
index: meta.index,
cancellable: true
cancelable: true
};

if (me.notifyPlugins('beforeDatasetDraw', args) === false) {
Expand All @@ -709,7 +709,7 @@ class Chart {

unclipArea(ctx);

args.cancellable = false;
args.cancelable = false;
me.notifyPlugins('afterDatasetDraw', args);
}

Expand Down Expand Up @@ -1024,15 +1024,15 @@ 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;
}

const changed = me._handleEvent(e, replay);

args.cancellable = false;
args.cancelable = false;
me.notifyPlugins('afterEvent', args);

if (changed || args.changed) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.plugins.js
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/specs/core.plugin.tests.js
Expand Up @@ -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();
Expand Down

0 comments on commit 00dbe71

Please sign in to comment.