mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
added forceupdate to grid item so addpanel items rezie instantly, renamed function to copyPanel, fixed panel items height issue
This commit is contained in:
parent
0e0976b0a2
commit
0120023aba
@ -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) {
|
||||||
|
@ -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) {
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user