openmct/src/api/overlays/ProgressDialog.js
Nikhil c6f83dea8d Save and Finish blocking modal dialog Refactor and Styles #2500 (#2501)
* Save and Finish blocking modal dialog Refactor and Styles #2500

* created new template for ProgressDialogComponent

* Tweaks for #2501

- Normalized dialog icon size;
- Enhanced text formatting in dialog;
- Changed "Saving..." to remove ellipsis;
2019-11-20 11:46:03 -08:00

50 lines
1.3 KiB
JavaScript

import ProgressDialogComponent from './components/ProgressDialogComponent.vue';
import Overlay from './Overlay';
import Vue from 'vue';
var component;
class ProgressDialog extends Overlay {
constructor({progressPerc, progressText, iconClass, message, title, hint, timestamp, ...options}) {
component = new Vue({
provide: {
iconClass,
message,
title,
hint,
timestamp
},
components: {
ProgressDialogComponent: ProgressDialogComponent
},
data() {
return {
model: {
progressPerc: progressPerc || 0,
progressText
}
}
},
template: '<progress-dialog-component :model="model"></progress-dialog-component>'
}).$mount();
super({
element: component.$el,
size: 'fit',
dismissable: false,
...options
});
this.once('destroy', () => {
component.$destroy();
});
}
updateProgress(progressPerc, progressText) {
component.model.progressPerc = progressPerc;
component.model.progressText = progressText;
}
}
export default ProgressDialog;