Skip to content

Commit

Permalink
fix #1095 changed modal layout to fit the window (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
saidaipparla authored and offtherailz committed Oct 11, 2016
1 parent 82e3c25 commit f0c5e6b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 22 deletions.
4 changes: 2 additions & 2 deletions web/client/components/catalog/RecordGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const RecordGrid = React.createClass({
records: [],
onLayerAdd: () => {},
onError: () => {},
column: {xs: 12, sm: 6, md: 6, lg: 6}
column: {xs: 12, sm: 12, md: 6, lg: 6}
};
},
renderRecordItem(record) {
Expand All @@ -53,7 +53,7 @@ const RecordGrid = React.createClass({
if (this.props.records) {
let mapsList = this.props.records instanceof Array ? this.props.records : [this.props.records];
return (
<Grid className="record-grid" style={this.props.style}>
<Grid className="record-grid" fluid={true} style={this.props.style}>
<Row>
{mapsList.map(this.renderRecordItem)}
</Row>
Expand Down
4 changes: 2 additions & 2 deletions web/client/components/catalog/__tests__/RecordGrid-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('This test for Record Grid', () => {
const itemDom = ReactDOM.findDOMNode(item);
expect(itemDom).toExist();

expect(itemDom.className).toBe("record-grid container");
expect(itemDom.className).toBe("record-grid container-fluid");
});
// test data
it('creates the component with data', () => {
Expand All @@ -62,7 +62,7 @@ describe('This test for Record Grid', () => {

const itemDom = ReactDOM.findDOMNode(item);
expect(itemDom).toExist();
expect(itemDom.className).toBe("record-grid container");
expect(itemDom.className).toBe("record-grid container-fluid");

// check the thumbnail as a to verify thtat the url is really loaded into the component
let img = TestUtils.findRenderedDOMComponentWithTag(
Expand Down
2 changes: 1 addition & 1 deletion web/client/components/misc/Dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const Dialog = React.createClass({
</Draggable>);
let containerStyle = assign({}, this.props.style, this.props.backgroundStyle);
return this.props.modal ?
(<div onClick={this.props.onClickOut} style={containerStyle} className="fade in modal" role="dialog">
(<div onClick={this.props.onClickOut} style={containerStyle} className="fade in modal catalog_window" role="dialog">
<div onClick={(evt)=> {evt.preventDefault(); evt.stopPropagation(); }} className="modal-dialog" style={{background: "transparent"}}>
{dialog}
</div></div>) :
Expand Down
5 changes: 0 additions & 5 deletions web/client/jsapi/mapstore2.css
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,6 @@
min-width: 725px;
}

#mapstore-catalog-panel {
width: auto;
margin: 100px;
}

#mapstore-catalog-panel .record-item {
min-height: 150px;
}
Expand Down
10 changes: 3 additions & 7 deletions web/client/plugins/MetadataExplorer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ const MetadataExplorerComponent = React.createClass({
modal: true,
wrapWithPanel: true,
panelStyle: {
minWidth: "300px",
zIndex: 100,
position: "absolute",
overflow: "auto",
top: "100px",
right: "100px"
overflow: "auto"
},
panelClassName: "toolbar-panel",
toggleControl: () => {},
Expand All @@ -80,15 +76,15 @@ const MetadataExplorerComponent = React.createClass({
};
},
render() {
const panel = <div role="body"><Catalog {...this.props}/></div>;
const panel = <div role="body" className="modal_window"><Catalog {...this.props}/></div>;
if (this.props.wrap) {
if (this.props.active) {
if (this.props.wrapWithPanel) {
return (<Panel id={this.props.id} header={<span><span className="metadataexplorer-panel-title"><Message msgId="catalog.title"/></span><span className="shapefile-panel-close panel-close" onClick={ toggleControl.bind(null, 'styler', null)}></span></span>} style={this.props.panelStyle} className={this.props.panelClassName}>
{panel}
</Panel>);
}
return (<Dialog id="mapstore-catalog-panel" style={this.props.style}>
return (<Dialog modal id="mapstore-catalog-panel" style={assign({}, this.props.style, {display: "block" })}>
<span role="header"><span className="metadataexplorer-panel-title"><Message msgId="catalog.title"/></span><button onClick={this.props.toggleControl} className="print-panel-close close">{this.props.closeGlyph ? <Glyphicon glyph={this.props.closeGlyph}/> : <span>×</span>}</button></span>
{panel}
</Dialog>);
Expand Down
4 changes: 4 additions & 0 deletions web/client/plugins/metadataexplorer/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ div.record-grid .record-item .record-buttons {
#mapstore-catalog-panel button.search-button {
margin-bottom: 10px;
}
.catalog_window .modal-dialog {
width: 98%;
margin-top: 10px;
}
5 changes: 0 additions & 5 deletions web/client/product/assets/css/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,6 @@ html, body, #container, .fill {
min-width: 725px;
}

#mapstore-catalog-panel {
width: auto;
margin: 100px;
}

#mapstore-catalog-panel .record-item {
min-height: 150px;
}
Expand Down

0 comments on commit f0c5e6b

Please sign in to comment.