Improve compose form performance, upgrade JS dependencies. LightingBox

now allows to cycle through multiple images
This commit is contained in:
Eugen Rochko 2017-02-26 01:23:44 +01:00
parent 3e9d794ea5
commit 2c50687279
14 changed files with 1251 additions and 713 deletions

View file

@ -131,19 +131,14 @@ const Modal = React.createClass({
return null;
}
const url = media.get(index).get('url');
const hasLeft = index > 0;
const hasRight = index + 1 < media.size;
const url = media.get(index).get('url');
let leftNav, rightNav;
leftNav = rightNav = '';
if (hasLeft) {
leftNav = <div style={leftNavStyle} className='modal-container--nav' onClick={this.handlePrevClick}><i className='fa fa-fw fa-chevron-left' /></div>;
}
if (hasRight) {
if (media.size > 1) {
leftNav = <div style={leftNavStyle} className='modal-container--nav' onClick={this.handlePrevClick}><i className='fa fa-fw fa-chevron-left' /></div>;
rightNav = <div style={rightNavStyle} className='modal-container--nav' onClick={this.handleNextClick}><i className='fa fa-fw fa-chevron-right' /></div>;
}