added forceupdate to grid item so addpanel items rezie instantly, renamed function to copyPanel, fixed panel items height issue

This commit is contained in:
Patrick O'Carroll 2018-04-17 13:10:08 +02:00
parent 0e0976b0a2
commit 0120023aba
3 changed files with 6 additions and 4 deletions

View File

@ -152,11 +152,13 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
onResize(layout, oldItem, newItem) { onResize(layout, oldItem, newItem) {
this.panelMap[newItem.i].updateGridPos(newItem); this.panelMap[newItem.i].updateGridPos(newItem);
this.triggerForceUpdate();
} }
onResizeStop(layout, oldItem, newItem) { onResizeStop(layout, oldItem, newItem) {
this.updateGridPos(newItem, layout); this.updateGridPos(newItem, layout);
this.panelMap[newItem.i].resizeDone(); this.panelMap[newItem.i].resizeDone();
this.triggerForceUpdate();
} }
onDragStop(layout, oldItem, newItem) { onDragStop(layout, oldItem, newItem) {

View File

@ -195,7 +195,7 @@ export class PanelCtrl {
menu.push({ menu.push({
text: 'Copy', text: 'Copy',
click: 'ctrl.addToPanelList()', click: 'ctrl.copyPanel()',
role: 'Editor', role: 'Editor',
}); });
} }
@ -260,9 +260,9 @@ export class PanelCtrl {
}); });
} }
addToPanelList() { copyPanel() {
store.set(LS_PANEL_COPY_KEY, JSON.stringify(this.panel.getSaveModel())); store.set(LS_PANEL_COPY_KEY, JSON.stringify(this.panel.getSaveModel()));
appEvents.emit('alert-success', ['Panel temporarily added to panel list']); appEvents.emit('alert-success', ['Panel copied. Open new panel to paste']);
} }
replacePanel(newPanel, oldPanel) { replacePanel(newPanel, oldPanel) {

View File

@ -50,7 +50,7 @@
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
overflow: auto; overflow: auto;
height: calc(100% - 50px); height: 100%;
align-content: flex-start; align-content: flex-start;
justify-content: space-around; justify-content: space-around;
position: relative; position: relative;