Skip to content

Commit

Permalink
[changed] default "show more" behavior navigates to day view
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Nov 3, 2015
1 parent 80aa08f commit ee53bbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 56 deletions.
45 changes: 0 additions & 45 deletions examples/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,6 @@ function EventAgenda(props) {
}


let rand = ()=> (Math.floor(Math.random() * 20) - 10);

const modalStyle = {
position: 'fixed',
zIndex: 1040,
top: 0, bottom: 0, left: 0, right: 0
};

const backdropStyle = {
...modalStyle,
zIndex: 'auto',
backgroundColor: '#000',
opacity: 0.5
};

const dialogStyle = function() {
// we use some psuedo random coords so modals
// don't sit right on top of each other.
let top = 50 + rand();
let left = 50 + rand();

return {
position: 'absolute',
width: 400,
top: top + '%', left: left + '%',
transform: `translate(-${top}%, -${left}%)`,
border: '1px solid #e5e5e5',
backgroundColor: 'white',
boxShadow: '0 5px 15px rgba(0,0,0,.5)',
padding: 20
};
};

const Example = React.createClass({
getInitialState(){
return { showModal: false };
Expand All @@ -88,18 +55,6 @@ const Example = React.createClass({
}}
/>
</main>
<Modal
aria-labelledby='modal-label'
style={modalStyle}
backdropStyle={backdropStyle}
show={this.state.showModal}
onHide={this.close}
>
<div style={dialogStyle()} >
<h4 id='modal-label'>Text in a modal</h4>
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
</div>
</Modal>
</div>
);
},
Expand Down
11 changes: 1 addition & 10 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/codemirror.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/theme/neo.min.css"/>
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/3.4.0/es5-shim.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/3.4.0/es5-sham.js"></script>
<![endif]-->
</head>
<body>
<div id="root">
</div>
</body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/mode/javascript/javascript.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/mode/xml/xml.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/addon/mode/multiplex.js"></script>
<script src="static/bundle.js"></script>
</html>
</html>
5 changes: 4 additions & 1 deletion src/Month.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ let MonthView = React.createClass({
window.removeEventListener('resize', this._resizeListener, false)
},

render(){
render() {
var { date, culture, weekdayFormat } = this.props
, month = dates.visibleDays(date, culture)
, weeks = chunk(month, 7);
Expand Down Expand Up @@ -367,6 +367,9 @@ let MonthView = React.createClass({
overlay: { date, events, position }
})
}
else {
notify(this.props.onNavigate, [navigate.DATE, date])
}

notify(this.props.onShowMore, [events, date, slot])
},
Expand Down

0 comments on commit ee53bbc

Please sign in to comment.