Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Add overlay widget #655
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunkat committed Apr 20, 2017
1 parent 266d158 commit fdeb4c6
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/assets/css/overlayfield.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.overlay-field {
background: rgba(255,255,255,0.8);
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 500;
}

.overlay-type-field {
top: 40%;
position: absolute;
width: 80%;
left: 10%;
font-size: 70px;
height: 20%;
text-align: center;
border: none;
}
1 change: 1 addition & 0 deletions src/assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@import './inputs.css';
@import './notification.css';
@import './panel.css';
@import './overlayfield.css';
@import './table.css';
@import './tabs.css';
@import './tag.css';
Expand Down
21 changes: 21 additions & 0 deletions src/components/app/OverlayField.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React, { Component } from 'react';

class OverlayField extends Component {

componentDidMount(){
this.overlayWidget.focus();
}

render() {
return (
<div className="overlay-field">
<input
className="overlay-type-field"
ref={c => this.overlayWidget = c}
/>
</div>
)
}
}

export default OverlayField
12 changes: 11 additions & 1 deletion src/containers/DocList.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import DocumentList from '../components/app/DocumentList';
import Container from '../components/Container';
import Modal from '../components/app/Modal';
import RawModal from '../components/app/RawModal';
import OverlayField from '../components/app/OverlayField';

import {
getWindowBreadcrumb
Expand Down Expand Up @@ -77,7 +78,11 @@ class DocList extends Component {
query={query}
showIndicator={!modal.visible && !rawModal.visible}
>
{modal.visible &&
{
modal.visible &&
(!modal.layout.layoutType ||
modal.layout.layoutType === 'panel') &&

<Modal
windowType={modal.type}
data={modal.data}
Expand All @@ -100,6 +105,11 @@ class DocList extends Component {
}
/>
}
{
modal.visible &&
modal.layout.layoutType === 'singleOverlayField' &&
<OverlayField/>
}
{rawModal.visible &&
<RawModal
modalTitle={modalTitle}
Expand Down

0 comments on commit fdeb4c6

Please sign in to comment.