Skip to content

Commit ee53bbc

Browse files
committed
[changed] default "show more" behavior navigates to day view
1 parent 80aa08f commit ee53bbc

File tree

3 files changed

+5
-56
lines changed

3 files changed

+5
-56
lines changed

examples/App.js

-45
Original file line numberDiff line numberDiff line change
@@ -31,39 +31,6 @@ function EventAgenda(props) {
3131
}
3232

3333

34-
let rand = ()=> (Math.floor(Math.random() * 20) - 10);
35-
36-
const modalStyle = {
37-
position: 'fixed',
38-
zIndex: 1040,
39-
top: 0, bottom: 0, left: 0, right: 0
40-
};
41-
42-
const backdropStyle = {
43-
...modalStyle,
44-
zIndex: 'auto',
45-
backgroundColor: '#000',
46-
opacity: 0.5
47-
};
48-
49-
const dialogStyle = function() {
50-
// we use some psuedo random coords so modals
51-
// don't sit right on top of each other.
52-
let top = 50 + rand();
53-
let left = 50 + rand();
54-
55-
return {
56-
position: 'absolute',
57-
width: 400,
58-
top: top + '%', left: left + '%',
59-
transform: `translate(-${top}%, -${left}%)`,
60-
border: '1px solid #e5e5e5',
61-
backgroundColor: 'white',
62-
boxShadow: '0 5px 15px rgba(0,0,0,.5)',
63-
padding: 20
64-
};
65-
};
66-
6734
const Example = React.createClass({
6835
getInitialState(){
6936
return { showModal: false };
@@ -88,18 +55,6 @@ const Example = React.createClass({
8855
}}
8956
/>
9057
</main>
91-
<Modal
92-
aria-labelledby='modal-label'
93-
style={modalStyle}
94-
backdropStyle={backdropStyle}
95-
show={this.state.showModal}
96-
onHide={this.close}
97-
>
98-
<div style={dialogStyle()} >
99-
<h4 id='modal-label'>Text in a modal</h4>
100-
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula.</p>
101-
</div>
102-
</Modal>
10358
</div>
10459
);
10560
},

examples/index.html

+1-10
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,12 @@
88
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"/>
99
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/codemirror.min.css"/>
1010
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/theme/neo.min.css"/>
11-
<!--[if lt IE 9]>
12-
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
13-
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
14-
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
15-
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/3.4.0/es5-shim.js"></script>
16-
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/3.4.0/es5-sham.js"></script>
17-
<![endif]-->
1811
</head>
1912
<body>
2013
<div id="root">
2114
</div>
2215
</body>
2316
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.js"></script>
2417
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/mode/javascript/javascript.js"></script>
25-
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/mode/xml/xml.js"></script>
26-
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/addon/mode/multiplex.js"></script>
2718
<script src="static/bundle.js"></script>
28-
</html>
19+
</html>

src/Month.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ let MonthView = React.createClass({
105105
window.removeEventListener('resize', this._resizeListener, false)
106106
},
107107

108-
render(){
108+
render() {
109109
var { date, culture, weekdayFormat } = this.props
110110
, month = dates.visibleDays(date, culture)
111111
, weeks = chunk(month, 7);
@@ -367,6 +367,9 @@ let MonthView = React.createClass({
367367
overlay: { date, events, position }
368368
})
369369
}
370+
else {
371+
notify(this.props.onNavigate, [navigate.DATE, date])
372+
}
370373

371374
notify(this.props.onShowMore, [events, date, slot])
372375
},

0 commit comments

Comments
 (0)