Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2081 Feature grid style messed up on Firefox and EDGE #2087

Merged
merged 2 commits into from
Aug 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions web/client/components/layout/BorderLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@ const React = require('react');
* /></BorderLayout>
*
*/
module.exports = ({children, header, footer, columns}) =>
module.exports = ({children, header, footer, columns, height}) =>
(<div style={{
display: "flex",
flexDirection: "column",
width: "100%",
height: "100%"
height: "100%",
overflow: "hidden"
}}>
{header}
<div className={"ms2-border-layout-body"} style={{
display: "flex",
flex: 1
}}>
<main className="ms2-border-layout-content" style={{flex: 1}}>
{children}
{height ? <div style={{height}}>{children}</div> : children}
</main>
{columns}
{height ? <div style={{height}}>{columns}</div> : columns}
</div>
{footer}
</div>);
12 changes: 10 additions & 2 deletions web/client/plugins/FeatureEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const BorderLayout = require('../components/layout/BorderLayout');
const EMPTY_ARR = [];
const EMPTY_OBJ = {};
const {gridTools, gridEvents, pageEvents, toolbarEvents} = require('./featuregrid/index');
const ContainerDimensions = require('react-container-dimensions').default;

const FeatureDock = (props = {
tools: EMPTY_OBJ,
Expand All @@ -40,8 +41,12 @@ const FeatureDock = (props = {
// columns={[<aside style={{backgroundColor: "red", flex: "0 0 12em"}}>column-selector</aside>]}
return (<Dock {...dockProps} >
{props.open &&
<ContainerDimensions>
{ ({ height }) =>
// added height to solve resize issue in firefox, edge and ie
<BorderLayout
key={"feature-grid-container"}
height={height - (62 + 32)}
header={getHeader()}
columns={getPanels(props.tools)}
footer={getFooter(props)}>
Expand All @@ -59,8 +64,11 @@ const FeatureDock = (props = {
describeFeatureType={props.describe}
features={props.features}
minHeight={600}
tools={props.gridTools}
/></BorderLayout>}
tools={props.gridTools}/>
</BorderLayout> }

</ContainerDimensions>
}
</Dock>);
};
const selector = createSelector(
Expand Down
2 changes: 1 addition & 1 deletion web/client/plugins/featuregrid/panels/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const dialogs = {
};
const panelDefaultProperties = {
settings: {
style: { padding: '0 12px', overflow: "auto", flex: "0 0 14em", boxShadow: "inset 0px 0px 10px rgba(0, 0, 0, 0.4)"}
style: { padding: '0 12px', overflow: "auto", flex: "0 0 14em", boxShadow: "inset 0px 0px 10px rgba(0, 0, 0, 0.4)", height: "100%", minWidth: 195}
}
};

Expand Down
40 changes: 40 additions & 0 deletions web/client/themes/default/less/react-data-grid.less
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,43 @@
}

}

.data-grid-top-toolbar {
height: 62px;
overflow: hidden;
}

.data-grid-bottom-toolbar {
background-color: @ms2-color-background;
z-index: 1;
height: 32px;
overflow: hidden;
}

@media all and (max-width: 1024px) {
.data-grid-bottom-toolbar .col-md-3 {
width: 0;
display: none;
}

.data-grid-bottom-toolbar .col-md-6 {
width: 100%;
}

.data-grid-top-toolbar > .flex-center .col-xs-4:nth-child(1) {
width: ~"calc(100% - @{square-btn-size})";
padding: 0;
margin-left: 5px;
}

.data-grid-top-toolbar > .flex-center .col-xs-4:nth-child(2) {
width: 0;
display: none;
}

.data-grid-top-toolbar > .flex-center .col-xs-4:nth-child(3) {
width: @square-btn-size + 10;
padding: 0;
margin-right: 5px;
}
}