Commit 3de17ecd by Alexander Zobnin Committed by Torkel Ödegaard

dashboard grid: enable CSS transforms (#10125)

parent 017b337f
......@@ -30,7 +30,7 @@ function GridWrapper({size, layout, onLayoutChange, children, onResize, onResize
isResizable={true}
measureBeforeMount={false}
containerPadding={[0, 0]}
useCSSTransforms={false}
useCSSTransforms={true}
margin={[GRID_CELL_VMARGIN, GRID_CELL_VMARGIN]}
cols={GRID_COLUMN_COUNT}
rowHeight={GRID_CELL_HEIGHT}
......
///<reference path="../../headers/common.d.ts" />
import $ from 'jquery';
import {coreModule} from 'app/core/core';
var template = `
......@@ -106,13 +107,38 @@ function panelHeader($compile) {
}
});
elem.find('.panel-menu-toggle').click((evt) => {
console.log(evt);
togglePanelState();
});
function togglePanelMenu(e) {
if (!isDragged) {
e.stopPropagation();
togglePanelState();
elem.find('[data-toggle=dropdown]').dropdown('toggle');
}
}
/**
* Hack for adding special class 'dropdown-menu-open' to the panel.
* This class sets z-index for panel and prevents menu overlapping.
*/
function togglePanelState() {
const menuOpenClass = 'dropdown-menu-open';
const panelGridClass = '.react-grid-item.panel';
let panelElem = elem.find('[data-toggle=dropdown]').parentsUntil('.panel').parent();
let menuElem = elem.find('[data-toggle=dropdown]').parent();
panelElem = panelElem && panelElem.length ? panelElem[0] : undefined;
if (panelElem) {
panelElem = $(panelElem);
$(panelGridClass).removeClass(menuOpenClass);
let state = !menuElem.hasClass('open');
panelElem.toggleClass(menuOpenClass, state);
}
}
let mouseX, mouseY;
elem.mousedown((e) => {
mouseX = e.pageX;
......
......@@ -47,3 +47,10 @@
}
}
// Hack for preventing panel menu overlapping.
.react-grid-item.resizing.panel,
.react-grid-item.panel.dropdown-menu-open,
.react-grid-item.react-draggable-dragging.panel {
z-index: $zindex-dropdown;
}
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