Skip to content

Commit

Permalink
refactor(addon/mixins/proxiable-mixin): migrates to es5 setter/getter…
Browse files Browse the repository at this point in the history
… to support classic and glimmer components.
  • Loading branch information
matthewhartstonge committed Nov 14, 2024
1 parent eddf64f commit 1e72457
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions addon/mixins/proxiable-mixin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable prettier/prettier */
/**
* @module ember-paper
*/
Expand All @@ -13,7 +12,6 @@ import { ChildMixin } from 'ember-composability-tools';
* @extends Ember.Mixin
*/
export default Mixin.create(ChildMixin, {

classNameBindings: ['secondary:md-secondary'],

shouldRegister: false,
Expand All @@ -26,29 +24,29 @@ export default Mixin.create(ChildMixin, {
this._super(...arguments);
let parentComponent = this.parentComponent;
if (parentComponent) {
parentComponent.set('mouseActive', true);
parentComponent.mouseActive = true;
later(() => {
if (parentComponent.isDestroyed) {
return;
}
parentComponent.set('mouseActive', false);
parentComponent.mouseActive = false;
}, 100);
}
},

focusIn() {
this._super(...arguments);
let parentComponent = this.parentComponent;
if (parentComponent && !parentComponent.get('mouseActive')) {
parentComponent.set('focused', true);
if (parentComponent && !parentComponent.mouseActive) {
parentComponent.focused = true;
}
},

focusOut() {
this._super(...arguments);
let parentComponent = this.parentComponent;
if (parentComponent) {
parentComponent.set('focused', false);
parentComponent.focused = false;
}
}
},
});

0 comments on commit 1e72457

Please sign in to comment.