mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed error when interacting with tag accent color input
closes https://github.com/TryGhost/Team/issues/744 - we were using `{{on}}` with a function on the component that wasn't bound to `this` via the `action` decorator meaning errors were thrown every time the input lost focus
This commit is contained in:
parent
85f579b785
commit
7a3b171f7f
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
import Ember from 'ember';
|
import Ember from 'ember';
|
||||||
|
import {action} from '@ember/object';
|
||||||
import {computed} from '@ember/object';
|
import {computed} from '@ember/object';
|
||||||
import {htmlSafe} from '@ember/template';
|
import {htmlSafe} from '@ember/template';
|
||||||
import {or} from '@ember/object/computed';
|
import {or} from '@ember/object/computed';
|
||||||
|
@ -161,7 +162,7 @@ export default Component.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
updateAccentColor: async function (event) {
|
updateAccentColor: action(async function (event) {
|
||||||
let newColor = event.target.value;
|
let newColor = event.target.value;
|
||||||
const oldColor = this.tag.get('accentColor');
|
const oldColor = this.tag.get('accentColor');
|
||||||
|
|
||||||
|
@ -199,7 +200,7 @@ export default Component.extend({
|
||||||
this.tag.errors.add('accentColor', 'The colour should be in valid hex format');
|
this.tag.errors.add('accentColor', 'The colour should be in valid hex format');
|
||||||
this.tag.hasValidated.pushObject('accentColor');
|
this.tag.hasValidated.pushObject('accentColor');
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
|
|
||||||
debounceUpdateAccentColor: task(function*(event) {
|
debounceUpdateAccentColor: task(function*(event) {
|
||||||
yield timeout(10);
|
yield timeout(10);
|
||||||
|
|
Loading…
Add table
Reference in a new issue