From 7ab831d4350b831f8cbcc63b55f487ed90f3ca02 Mon Sep 17 00:00:00 2001 From: Miguel Andrade Date: Fri, 25 Jan 2019 18:33:34 +0000 Subject: [PATCH] remove deprecated usage of sendAction --- addon/components/datepicker-support.js | 28 +++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/addon/components/datepicker-support.js b/addon/components/datepicker-support.js index 792c2c5..8b7b613 100644 --- a/addon/components/datepicker-support.js +++ b/addon/components/datepicker-support.js @@ -55,13 +55,19 @@ export default Mixin.create({ }); }). on('changeMonth', event => { - this.sendAction('changeMonth', event.date); + if (this.changeMonth) { + this.changeMonth(event.date); + } }). on('focusout', event => { - this.sendAction('focus-out', this, event); + if (this['focus-out']) { + this['focus-out'](this, event); + } }). on('focusin', event => { - this.sendAction('focus-in', this, event); + if (this['focus-in']) { + this['focus-in'](this, event); + } }). on('clearDate', event => { run(() => { @@ -69,10 +75,14 @@ export default Mixin.create({ }); }). on('show', () => { - this.sendAction('show'); + if (this.show) { + this.show(); + } }). on('hide', () => { - this.sendAction('hide'); + if (this.hide) { + this.hide(); + } }); this._updateDatepicker(); @@ -100,9 +110,13 @@ export default Mixin.create({ this.set('mustUpdateInput', false); this.set('value', value); if (event.type === 'clearDate') { - this.sendAction('clearDate'); + if (this.clearDate) { + this.clearDate(); + } } else { - this.sendAction('changeDate', value); + if (this.changeDate) { + this.changeDate(value); + } } },