mirror of
https://github.com/nasa/openmct.git
synced 2025-01-15 01:10:51 +00:00
c6f83dea8d
* 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;
50 lines
1.3 KiB
JavaScript
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;
|