Converting preview image modal to use react-bootstrap. Fixes issue where modal would appear behind background on iOS
Этот коммит содержится в:
@@ -143,10 +143,7 @@ export default class FileAttachment extends React.Component {
|
|||||||
>
|
>
|
||||||
<a className='post-image__thumbnail'
|
<a className='post-image__thumbnail'
|
||||||
href='#'
|
href='#'
|
||||||
onClick={this.props.handleImageClick}
|
onClick={() => this.props.handleImageClick(this.props.index)}
|
||||||
data-img-id={this.props.index}
|
|
||||||
data-toggle='modal'
|
|
||||||
data-target={'#' + this.props.modalId}
|
|
||||||
>
|
>
|
||||||
{thumbnail}
|
{thumbnail}
|
||||||
</a>
|
</a>
|
||||||
@@ -187,9 +184,6 @@ FileAttachment.propTypes = {
|
|||||||
// the index of this attachment preview in the parent FileAttachmentList
|
// the index of this attachment preview in the parent FileAttachmentList
|
||||||
index: React.PropTypes.number.isRequired,
|
index: React.PropTypes.number.isRequired,
|
||||||
|
|
||||||
// the identifier of the modal dialog used to preview files
|
// handler for when the thumbnail is clicked passed the index above
|
||||||
modalId: React.PropTypes.string.isRequired,
|
|
||||||
|
|
||||||
// handler for when the thumbnail is clicked
|
|
||||||
handleImageClick: React.PropTypes.func
|
handleImageClick: React.PropTypes.func
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,23 +11,21 @@ export default class FileAttachmentList extends React.Component {
|
|||||||
|
|
||||||
this.handleImageClick = this.handleImageClick.bind(this);
|
this.handleImageClick = this.handleImageClick.bind(this);
|
||||||
|
|
||||||
this.state = {startImgId: 0};
|
this.state = {showPreviewModal: false, startImgId: 0};
|
||||||
}
|
}
|
||||||
handleImageClick(e) {
|
handleImageClick(indexClicked) {
|
||||||
this.setState({startImgId: parseInt($(e.target.parentNode).attr('data-img-id'), 10)});
|
this.setState({showPreviewModal: true, startImgId: indexClicked});
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
var filenames = this.props.filenames;
|
var filenames = this.props.filenames;
|
||||||
var modalId = this.props.modalId;
|
|
||||||
|
|
||||||
var postFiles = [];
|
var postFiles = [];
|
||||||
for (var i = 0; i < filenames.length && i < Constants.MAX_DISPLAY_FILES; i++) {
|
for (var i = 0; i < filenames.length && i < Constants.MAX_DISPLAY_FILES; i++) {
|
||||||
postFiles.push(
|
postFiles.push(
|
||||||
<FileAttachment
|
<FileAttachment
|
||||||
key={i}
|
key={'file_attachment_' + i}
|
||||||
filename={filenames[i]}
|
filename={filenames[i]}
|
||||||
index={i}
|
index={i}
|
||||||
modalId={modalId}
|
|
||||||
handleImageClick={this.handleImageClick}
|
handleImageClick={this.handleImageClick}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -39,9 +37,10 @@ export default class FileAttachmentList extends React.Component {
|
|||||||
{postFiles}
|
{postFiles}
|
||||||
</div>
|
</div>
|
||||||
<ViewImageModal
|
<ViewImageModal
|
||||||
|
show={this.state.showPreviewModal}
|
||||||
|
onModalDismissed={() => this.setState({showPreviewModal: false})}
|
||||||
channelId={this.props.channelId}
|
channelId={this.props.channelId}
|
||||||
userId={this.props.userId}
|
userId={this.props.userId}
|
||||||
modalId={modalId}
|
|
||||||
startId={this.state.startImgId}
|
startId={this.state.startImgId}
|
||||||
filenames={filenames}
|
filenames={filenames}
|
||||||
/>
|
/>
|
||||||
@@ -55,9 +54,6 @@ FileAttachmentList.propTypes = {
|
|||||||
// a list of file pathes displayed by this
|
// a list of file pathes displayed by this
|
||||||
filenames: React.PropTypes.arrayOf(React.PropTypes.string).isRequired,
|
filenames: React.PropTypes.arrayOf(React.PropTypes.string).isRequired,
|
||||||
|
|
||||||
// the identifier of the modal dialog used to preview files
|
|
||||||
modalId: React.PropTypes.string.isRequired,
|
|
||||||
|
|
||||||
// the channel that this is part of
|
// the channel that this is part of
|
||||||
channelId: React.PropTypes.string,
|
channelId: React.PropTypes.string,
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,6 @@ export default class PostBody extends React.Component {
|
|||||||
fileAttachmentHolder = (
|
fileAttachmentHolder = (
|
||||||
<FileAttachmentList
|
<FileAttachmentList
|
||||||
filenames={filenames}
|
filenames={filenames}
|
||||||
modalId={`view_image_modal_${post.id}`}
|
|
||||||
channelId={post.channel_id}
|
channelId={post.channel_id}
|
||||||
userId={post.user_id}
|
userId={post.user_id}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ export default class RhsComment extends React.Component {
|
|||||||
fileAttachment = (
|
fileAttachment = (
|
||||||
<FileAttachmentList
|
<FileAttachmentList
|
||||||
filenames={post.filenames}
|
filenames={post.filenames}
|
||||||
modalId={'rhs_comment_view_image_modal_' + post.id}
|
|
||||||
channelId={post.channel_id}
|
channelId={post.channel_id}
|
||||||
userId={post.user_id}
|
userId={post.user_id}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ export default class RhsRootPost extends React.Component {
|
|||||||
fileAttachment = (
|
fileAttachment = (
|
||||||
<FileAttachmentList
|
<FileAttachmentList
|
||||||
filenames={post.filenames}
|
filenames={post.filenames}
|
||||||
modalId={'rhs_view_image_modal_' + post.id}
|
|
||||||
channelId={post.channel_id}
|
channelId={post.channel_id}
|
||||||
userId={post.user_id}
|
userId={post.user_id}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
var Client = require('../utils/client.jsx');
|
var Client = require('../utils/client.jsx');
|
||||||
var Utils = require('../utils/utils.jsx');
|
var Utils = require('../utils/utils.jsx');
|
||||||
|
var ViewImagePopoverBar = require('./view_image_popover_bar.jsx');
|
||||||
|
var Modal = ReactBootstrap.Modal;
|
||||||
|
|
||||||
export default class ViewImageModal extends React.Component {
|
export default class ViewImageModal extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -16,6 +18,10 @@ export default class ViewImageModal extends React.Component {
|
|||||||
this.handleKeyPress = this.handleKeyPress.bind(this);
|
this.handleKeyPress = this.handleKeyPress.bind(this);
|
||||||
this.getPublicLink = this.getPublicLink.bind(this);
|
this.getPublicLink = this.getPublicLink.bind(this);
|
||||||
this.getPreviewImagePath = this.getPreviewImagePath.bind(this);
|
this.getPreviewImagePath = this.getPreviewImagePath.bind(this);
|
||||||
|
this.onModalShown = this.onModalShown.bind(this);
|
||||||
|
this.onModalHidden = this.onModalHidden.bind(this);
|
||||||
|
this.onMouseEnterImage = this.onMouseEnterImage.bind(this);
|
||||||
|
this.onMouseLeaveImage = this.onMouseLeaveImage.bind(this);
|
||||||
|
|
||||||
var loaded = [];
|
var loaded = [];
|
||||||
var progress = [];
|
var progress = [];
|
||||||
@@ -23,9 +29,18 @@ export default class ViewImageModal extends React.Component {
|
|||||||
loaded.push(false);
|
loaded.push(false);
|
||||||
progress.push(0);
|
progress.push(0);
|
||||||
}
|
}
|
||||||
this.state = {imgId: this.props.startId, viewed: false, loaded: loaded, progress: progress, images: {}, fileSizes: {}};
|
this.state = {
|
||||||
|
imgId: this.props.startId,
|
||||||
|
imgHeight: '100%',
|
||||||
|
loaded: loaded,
|
||||||
|
progress: progress,
|
||||||
|
images: {},
|
||||||
|
fileSizes: {},
|
||||||
|
showFooter: false
|
||||||
|
};
|
||||||
}
|
}
|
||||||
handleNext() {
|
handleNext(e) {
|
||||||
|
e.stopPropagation();
|
||||||
var id = this.state.imgId + 1;
|
var id = this.state.imgId + 1;
|
||||||
if (id > this.props.filenames.length - 1) {
|
if (id > this.props.filenames.length - 1) {
|
||||||
id = 0;
|
id = 0;
|
||||||
@@ -33,7 +48,8 @@ export default class ViewImageModal extends React.Component {
|
|||||||
this.setState({imgId: id});
|
this.setState({imgId: id});
|
||||||
this.loadImage(id);
|
this.loadImage(id);
|
||||||
}
|
}
|
||||||
handlePrev() {
|
handlePrev(e) {
|
||||||
|
e.stopPropagation();
|
||||||
var id = this.state.imgId - 1;
|
var id = this.state.imgId - 1;
|
||||||
if (id < 0) {
|
if (id < 0) {
|
||||||
id = this.props.filenames.length - 1;
|
id = this.props.filenames.length - 1;
|
||||||
@@ -50,15 +66,27 @@ export default class ViewImageModal extends React.Component {
|
|||||||
this.handlePrev();
|
this.handlePrev();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentWillReceiveProps(nextProps) {
|
onModalShown(nextProps) {
|
||||||
this.setState({imgId: nextProps.startId});
|
this.setState({imgId: nextProps.startId});
|
||||||
|
this.loadImage(nextProps.startId);
|
||||||
|
}
|
||||||
|
onModalHidden() {
|
||||||
|
if (this.refs.video) {
|
||||||
|
var video = React.findDOMNode(this.refs.video);
|
||||||
|
video.pause();
|
||||||
|
video.currentTime = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
if (nextProps.show === true && this.props.show === false) {
|
||||||
|
this.onModalShown(nextProps);
|
||||||
|
} else if (nextProps.show === false && this.props.show === true) {
|
||||||
|
this.onModalHidden();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
loadImage(id) {
|
loadImage(id) {
|
||||||
var imgHeight = $(window).height() - 100;
|
var imgHeight = $(window).height() - 100;
|
||||||
if (this.state.loaded[id] || this.state.images[id]) {
|
this.setState({imgHeight});
|
||||||
$('.modal .modal-image .image-wrapper img').css('max-height', imgHeight);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var filename = this.props.filenames[id];
|
var filename = this.props.filenames[id];
|
||||||
|
|
||||||
@@ -68,84 +96,27 @@ export default class ViewImageModal extends React.Component {
|
|||||||
if (fileType === 'image') {
|
if (fileType === 'image') {
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.load(this.getPreviewImagePath(filename),
|
img.load(this.getPreviewImagePath(filename),
|
||||||
function load() {
|
() => {
|
||||||
var progress = this.state.progress;
|
const progress = this.state.progress;
|
||||||
progress[id] = img.completedPercentage;
|
progress[id] = img.completedPercentage;
|
||||||
this.setState({progress: progress});
|
this.setState({progress});
|
||||||
}.bind(this));
|
});
|
||||||
img.onload = (function onload(imgid) {
|
img.onload = () => {
|
||||||
return function onloadReturn() {
|
const loaded = this.state.loaded;
|
||||||
var loaded = this.state.loaded;
|
loaded[id] = true;
|
||||||
loaded[imgid] = true;
|
this.setState({loaded});
|
||||||
this.setState({loaded: loaded});
|
};
|
||||||
$(React.findDOMNode(this.refs.image)).css('max-height', imgHeight);
|
|
||||||
}.bind(this);
|
|
||||||
}.bind(this)(id));
|
|
||||||
var images = this.state.images;
|
var images = this.state.images;
|
||||||
images[id] = img;
|
images[id] = img;
|
||||||
this.setState({images: images});
|
this.setState({images});
|
||||||
} else {
|
} else {
|
||||||
// there's nothing to load for non-image files
|
// there's nothing to load for non-image files
|
||||||
var loaded = this.state.loaded;
|
var loaded = this.state.loaded;
|
||||||
loaded[id] = true;
|
loaded[id] = true;
|
||||||
this.setState({loaded: loaded});
|
this.setState({loaded});
|
||||||
}
|
|
||||||
}
|
|
||||||
componentDidUpdate() {
|
|
||||||
if (this.state.loaded[this.state.imgId]) {
|
|
||||||
if (this.refs.imageWrap) {
|
|
||||||
$(React.findDOMNode(this.refs.imageWrap)).removeClass('default');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
$('#' + this.props.modalId).on('shown.bs.modal', function onModalShow() {
|
|
||||||
this.setState({viewed: true});
|
|
||||||
this.loadImage(this.state.imgId);
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
$('#' + this.props.modalId).on('hidden.bs.modal', function onModalHide() {
|
|
||||||
if (this.refs.video) {
|
|
||||||
var video = React.findDOMNode(this.refs.video);
|
|
||||||
video.pause();
|
|
||||||
video.currentTime = 0;
|
|
||||||
}
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
$(React.findDOMNode(this.refs.modal)).click(function onModalClick(e) {
|
|
||||||
if (e.target === this || e.target === React.findDOMNode(this.refs.imageBody)) {
|
|
||||||
$('.image_modal').modal('hide');
|
|
||||||
}
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
$(React.findDOMNode(this.refs.imageWrap)).hover(
|
|
||||||
function onModalHover() {
|
|
||||||
$(React.findDOMNode(this.refs.imageFooter)).addClass('footer--show');
|
|
||||||
}.bind(this), function offModalHover() {
|
|
||||||
$(React.findDOMNode(this.refs.imageFooter)).removeClass('footer--show');
|
|
||||||
}.bind(this)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this.refs.previewArrowLeft) {
|
|
||||||
$(React.findDOMNode(this.refs.previewArrowLeft)).hover(
|
|
||||||
function onModalHover() {
|
|
||||||
$(React.findDOMNode(this.refs.imageFooter)).addClass('footer--show');
|
|
||||||
}.bind(this), function offModalHover() {
|
|
||||||
$(React.findDOMNode(this.refs.imageFooter)).removeClass('footer--show');
|
|
||||||
}.bind(this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.refs.previewArrowRight) {
|
|
||||||
$(React.findDOMNode(this.refs.previewArrowRight)).hover(
|
|
||||||
function onModalHover() {
|
|
||||||
$(React.findDOMNode(this.refs.imageFooter)).addClass('footer--show');
|
|
||||||
}.bind(this), function offModalHover() {
|
|
||||||
$(React.findDOMNode(this.refs.imageFooter)).removeClass('footer--show');
|
|
||||||
}.bind(this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$(window).on('keyup', this.handleKeyPress);
|
$(window).on('keyup', this.handleKeyPress);
|
||||||
|
|
||||||
// keep track of whether or not this component is mounted so we can safely set the state asynchronously
|
// keep track of whether or not this component is mounted so we can safely set the state asynchronously
|
||||||
@@ -189,6 +160,12 @@ export default class ViewImageModal extends React.Component {
|
|||||||
// only images have proper previews, so just use a placeholder icon for non-images
|
// only images have proper previews, so just use a placeholder icon for non-images
|
||||||
return Utils.getPreviewImagePathForFileType(fileType);
|
return Utils.getPreviewImagePathForFileType(fileType);
|
||||||
}
|
}
|
||||||
|
onMouseEnterImage() {
|
||||||
|
this.setState({showFooter: true});
|
||||||
|
}
|
||||||
|
onMouseLeaveImage() {
|
||||||
|
this.setState({showFooter: false});
|
||||||
|
}
|
||||||
render() {
|
render() {
|
||||||
if (this.props.filenames.length < 1 || this.props.filenames.length - 1 < this.state.imgId) {
|
if (this.props.filenames.length < 1 || this.props.filenames.length - 1 < this.state.imgId) {
|
||||||
return <div/>;
|
return <div/>;
|
||||||
@@ -299,23 +276,6 @@ export default class ViewImageModal extends React.Component {
|
|||||||
bgClass = 'black-bg';
|
bgClass = 'black-bg';
|
||||||
}
|
}
|
||||||
|
|
||||||
var publicLink = '';
|
|
||||||
if (global.window.config.EnablePublicLink === 'true') {
|
|
||||||
publicLink = (
|
|
||||||
<div>
|
|
||||||
<a
|
|
||||||
href='#'
|
|
||||||
className='public-link text'
|
|
||||||
data-title='Public Image'
|
|
||||||
onClick={this.getPublicLink}
|
|
||||||
>
|
|
||||||
Get Public Link
|
|
||||||
</a>
|
|
||||||
<span className='text'> | </span>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
var leftArrow = '';
|
var leftArrow = '';
|
||||||
var rightArrow = '';
|
var rightArrow = '';
|
||||||
if (this.props.filenames.length > 1) {
|
if (this.props.filenames.length > 1) {
|
||||||
@@ -342,65 +302,61 @@ export default class ViewImageModal extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let closeButtonClass = 'modal-close';
|
||||||
|
if (this.state.showFooter) {
|
||||||
|
closeButtonClass += ' modal-close--show';
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<Modal
|
||||||
className='modal fade image_modal'
|
show={this.props.show}
|
||||||
ref='modal'
|
onHide={this.props.onModalDismissed}
|
||||||
id={this.props.modalId}
|
className='image_modal'
|
||||||
tabIndex='-1'
|
dialogClassName='modal-image'
|
||||||
role='dialog'
|
|
||||||
aria-hidden='true'
|
|
||||||
>
|
>
|
||||||
<div className='modal-dialog modal-image'>
|
<Modal.Body
|
||||||
<div className='modal-content image-content'>
|
modalClassName='image-body'
|
||||||
|
onClick={this.props.onModalDismissed}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={'image-wrapper ' + bgClass}
|
||||||
|
style={{maxHeight: this.state.imgHeight}}
|
||||||
|
onMouseEnter={this.onMouseEnterImage}
|
||||||
|
onMouseLeave={this.onMouseLeaveImage}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
ref='imageBody'
|
className={closeButtonClass}
|
||||||
className='modal-body image-body'
|
onClick={this.props.onModalDismissed}
|
||||||
>
|
/>
|
||||||
<div
|
{content}
|
||||||
ref='imageWrap'
|
<ViewImagePopoverBar
|
||||||
className={'image-wrapper default ' + bgClass}
|
show={this.state.showFooter}
|
||||||
>
|
fileId={this.state.imgId}
|
||||||
<div
|
totalFiles={this.props.filenames.length}
|
||||||
className='modal-close'
|
filename={name}
|
||||||
data-dismiss='modal'
|
fileURL={fileUrl}
|
||||||
/>
|
onGetPublicLinkPressed={this.getPublicLink}
|
||||||
{content}
|
/>
|
||||||
<div
|
|
||||||
ref='imageFooter'
|
|
||||||
className='modal-button-bar'
|
|
||||||
>
|
|
||||||
<span className='pull-left text'>{'File ' + (this.state.imgId + 1) + ' of ' + this.props.filenames.length}</span>
|
|
||||||
<div className='image-links'>
|
|
||||||
{publicLink}
|
|
||||||
<a
|
|
||||||
href={fileUrl}
|
|
||||||
download={name}
|
|
||||||
className='text'
|
|
||||||
>
|
|
||||||
Download
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{leftArrow}
|
|
||||||
{rightArrow}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{leftArrow}
|
||||||
</div>
|
{rightArrow}
|
||||||
|
</Modal.Body>
|
||||||
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewImageModal.defaultProps = {
|
ViewImageModal.defaultProps = {
|
||||||
|
show: false,
|
||||||
filenames: [],
|
filenames: [],
|
||||||
modalId: '',
|
|
||||||
channelId: '',
|
channelId: '',
|
||||||
userId: '',
|
userId: '',
|
||||||
startId: 0
|
startId: 0
|
||||||
};
|
};
|
||||||
ViewImageModal.propTypes = {
|
ViewImageModal.propTypes = {
|
||||||
|
show: React.PropTypes.bool.isRequired,
|
||||||
|
onModalDismissed: React.PropTypes.func.isRequired,
|
||||||
filenames: React.PropTypes.array,
|
filenames: React.PropTypes.array,
|
||||||
modalId: React.PropTypes.string,
|
modalId: React.PropTypes.string,
|
||||||
channelId: React.PropTypes.string,
|
channelId: React.PropTypes.string,
|
||||||
|
|||||||
66
web/react/components/view_image_popover_bar.jsx
Обычный файл
66
web/react/components/view_image_popover_bar.jsx
Обычный файл
@@ -0,0 +1,66 @@
|
|||||||
|
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
||||||
|
// See License.txt for license information.
|
||||||
|
|
||||||
|
export default class ViewImagePopoverBar extends React.Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
var publicLink = '';
|
||||||
|
if (global.window.config.EnablePublicLink === 'true') {
|
||||||
|
publicLink = (
|
||||||
|
<div>
|
||||||
|
<a
|
||||||
|
href='#'
|
||||||
|
className='public-link text'
|
||||||
|
data-title='Public Image'
|
||||||
|
onClick={this.getPublicLink}
|
||||||
|
>
|
||||||
|
{'Get Public Link'}
|
||||||
|
</a>
|
||||||
|
<span className='text'>{' | '}</span>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
var footerClass = 'modal-button-bar';
|
||||||
|
if (this.props.show) {
|
||||||
|
footerClass += ' footer--show';
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
ref='imageFooter'
|
||||||
|
className={footerClass}
|
||||||
|
>
|
||||||
|
<span className='pull-left text'>{'File ' + (this.props.fileId + 1) + ' of ' + this.props.totalFiles}</span>
|
||||||
|
<div className='image-links'>
|
||||||
|
{publicLink}
|
||||||
|
<a
|
||||||
|
href={this.props.fileURL}
|
||||||
|
download={this.props.filename}
|
||||||
|
className='text'
|
||||||
|
>
|
||||||
|
{'Download'}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ViewImagePopoverBar.defaultProps = {
|
||||||
|
show: false,
|
||||||
|
imgId: 0,
|
||||||
|
totalFiles: 0,
|
||||||
|
filename: '',
|
||||||
|
fileURL: ''
|
||||||
|
};
|
||||||
|
|
||||||
|
ViewImagePopoverBar.propTypes = {
|
||||||
|
show: React.PropTypes.bool.isRequired,
|
||||||
|
fileId: React.PropTypes.number.isRequired,
|
||||||
|
totalFiles: React.PropTypes.number.isRequired,
|
||||||
|
filename: React.PropTypes.string.isRequired,
|
||||||
|
fileURL: React.PropTypes.string.isRequired,
|
||||||
|
onGetPublicLinkPressed: React.PropTypes.func.isRequired
|
||||||
|
};
|
||||||
@@ -190,16 +190,13 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
min-height: 100px;
|
min-height: 100px;
|
||||||
min-width: 320px;
|
min-width: 240px;
|
||||||
@include border-radius(3px);
|
@include border-radius(3px);
|
||||||
display: table;
|
display: table;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
&:hover {
|
&:hover {
|
||||||
@include border-radius(3px 3px 0 0);
|
@include border-radius(3px 3px 0 0);
|
||||||
}
|
}
|
||||||
&:hover .modal-close {
|
|
||||||
@include opacity(1);
|
|
||||||
}
|
|
||||||
&.default {
|
&.default {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 80%;
|
height: 80%;
|
||||||
@@ -213,8 +210,15 @@
|
|||||||
right: -13px;
|
right: -13px;
|
||||||
top: -13px;
|
top: -13px;
|
||||||
@include opacity(0);
|
@include opacity(0);
|
||||||
|
-webkit-transition: opacity 0.6s;
|
||||||
|
-moz-transition: opacity 0.6s;
|
||||||
|
-o-transition: opacity 0.6s;
|
||||||
|
transition: opacity 0.6s;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
|
&.modal-close--show {
|
||||||
|
@include opacity(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
> a {
|
> a {
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
@@ -226,7 +230,7 @@
|
|||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.image-content {
|
.modal-content{
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
background: rgba(0, 0, 0, 0);
|
background: rgba(0, 0, 0, 0);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -310,6 +314,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Invite New Member
|
// Invite New Member
|
||||||
.invite {
|
.invite {
|
||||||
margin-right: 40px;
|
margin-right: 40px;
|
||||||
@@ -324,4 +329,4 @@
|
|||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user