open-consul/ui/packages/consul-ui/app/modifiers/css-prop.js
Ronald 6bcb98ea71
Add UI copyright headers files (#16614)
* Add copyright headers to UI files

* Ensure copywrite file ignores external libs
2023-03-14 09:18:55 -04:00

18 lines
509 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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]));
}
}