1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/components/gh-progress-bar.js
Kevin Ansfield 4b48328e6d SimpleMDE editor (#682)
no issue

* move "save on first change" behaviour into editor controller
* allow TAB events to be specified in keyEvents hash of gh-input
* replace mobiledoc-kit/gh-koenig with a SimpleMDE based editor
    - remove `gh-koenig` in-repo-addon from `package.json` so that test files etc aren't loaded
    - remove `mobiledoc-kit` dependencies
    - extends `gh-editor` to handle file drag/drop
    - adds `gh-uploader` and `gh-progress-bar` components to handle file uploads in a more composable manner
    - adds `gh-simplemde` component that wraps SimpleMDE
2017-05-08 11:35:42 +01:00

23 lines
497 B
JavaScript

import Component from 'ember-component';
import {htmlSafe} from 'ember-string';
export default Component.extend({
tagName: '',
// Public attributes
percentage: 0,
isError: false,
// Internal attributes
progressStyle: '',
didReceiveAttrs() {
this._super(...arguments);
let percentage = this.get('percentage');
let width = (percentage > 0) ? `${percentage}%` : '0';
this.set('progressStyle', htmlSafe(`width: ${width}`));
}
});