Skip to content

Commit a72f663

Browse files
authored
Replace a modal resize hack with usage of the action-menu store. (#15683)
Fixes #10559
1 parent 5b44ee9 commit a72f663

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

shell/dialog/RollbackWorkloadDialog.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,9 @@ export default {
165165
return option.label;
166166
},
167167
sizeDialog() {
168-
const dialogs = document.getElementsByClassName('modal-container');
169-
const width = this.showDiff ? '85%' : '600px';
168+
const modalWidth = this.showDiff ? '85%' : '600px';
170169
171-
if (dialogs.length === 1) {
172-
dialogs[0].style.setProperty('width', width);
173-
}
170+
this.$store.commit('action-menu/updateModalData', [{ key: 'modalWidth', value: modalWidth }]);
174171
},
175172
sanitizeYaml(obj, path = '') {
176173
const res = {};

shell/store/action-menu.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ export const mutations = {
111111
state.modalData = data;
112112
},
113113

114+
updateModalData(state, data) {
115+
state.modalData = state.modalData || {};
116+
117+
data.forEach(({ key, value }) => {
118+
state.modalData[key] = value;
119+
});
120+
},
121+
114122
clearCallbackData(state) {
115123
state.performCallbackData = undefined;
116124
},

0 commit comments

Comments
 (0)