Commit f74f7b01 by Torkel Ödegaard

Minor progress on edit mode

parent c54ae5d1
......@@ -8,6 +8,7 @@ import classNames from 'classnames';
import sizeMe from 'react-sizeme';
let lastGridWidth = 1200;
let ignoreNextWidthChange = false;
function GridWrapper({
size,
......@@ -24,8 +25,12 @@ function GridWrapper({
isFullscreen,
}) {
const width = size.width > 0 ? size.width : lastGridWidth;
// logic to ignore width changes (optimization)
if (width !== lastGridWidth) {
if (!isFullscreen && Math.abs(width - lastGridWidth) > 8) {
if (ignoreNextWidthChange) {
ignoreNextWidthChange = false;
} else if (!isFullscreen && Math.abs(width - lastGridWidth) > 8) {
onWidthChange();
lastGridWidth = width;
}
......@@ -138,6 +143,7 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
}
onViewModeChanged(payload) {
ignoreNextWidthChange = true;
this.setState({ animated: !payload.fullscreen });
}
......
......@@ -23,7 +23,5 @@
<dash-links-container links="ctrl.dashboard.links" class="gf-form-inline"></dash-links-container>
</div>
<gf-time-picker class="gf-timepicker-nav" dashboard="ctrl.dashboard" ng-if="ctrl.dashboard.meta.fullscreen"></gf-time-picker>
<div class="clearfix"></div>
</div>
......@@ -40,21 +40,12 @@
}
.panel-in-fullscreen {
.navbar {
// @include navbar-alt-look();
display: none;
}
.navbar-button--add-panel,
.navbar-button--star,
.navbar-button--tv,
.navbar-page-btn .fa-caret-down {
display: none;
}
.navbar-buttons--close {
display: flex;
}
}
.navbar-page-btn {
......@@ -103,7 +94,7 @@
display: flex;
align-items: center;
justify-content: flex-end;
// margin-right: $spacer;
margin-right: $spacer;
&--close {
display: none;
......
......@@ -28,24 +28,24 @@
}
.panel-in-fullscreen {
.scroll-canvas--dashboard {
height: 100%;
}
// .scroll-canvas--dashboard {
// height: 100%;
// }
.sidemenu {
display: none;
}
.main-view {
background: unset;
}
// .main-view {
// background: unset;
// }
.dashboard-container {
padding: 0;
}
.submenu-controls {
padding: $dashboard-padding $dashboard-padding $panel-margin $dashboard-padding;
padding: 0 $dashboard-padding $panel-margin $dashboard-padding;
}
.panel-editor-container__panel {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment