mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 12:53:13 +03:00
24 lines
494 B
JavaScript
24 lines
494 B
JavaScript
import Component from '@ember/component';
|
|
import {htmlSafe} from '@ember/template';
|
|
|
|
export default Component.extend({
|
|
tagName: '',
|
|
|
|
// Public attributes
|
|
percentage: 0,
|
|
isError: false,
|
|
|
|
// Internal attributes
|
|
progressStyle: '',
|
|
|
|
didReceiveAttrs() {
|
|
this._super(...arguments);
|
|
|
|
let percentage = this.percentage;
|
|
let width = (percentage > 0) ? `${percentage}%` : '0';
|
|
|
|
this.set('progressStyle', htmlSafe(`width: ${width}`));
|
|
}
|
|
|
|
});
|