mirror of
https://github.com/status-im/consul.git
synced 2025-01-19 18:19:53 +00:00
de13e207e5
Get the value for a single specific CSS Property from the modified element. returns can be specified either as a second parameter or an option.
13 lines
431 B
JavaScript
13 lines
431 B
JavaScript
import Modifier from 'ember-modifier';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export default class CSSPropModifier extends Modifier {
|
|
@service('-document') doc;
|
|
didReceiveArguments() {
|
|
const params = this.args.positional;
|
|
const options = this.args.named;
|
|
const returns = params[1] || options.returns;
|
|
returns(this.doc.defaultView.getComputedStyle(this.element).getPropertyValue(params[0]));
|
|
}
|
|
}
|