- Timestamp:
- 03/05/15 18:24:55 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/src/main/resources/assets/js/components.jsx
r6049 r6081 70 70 71 71 72 window.MyReact.ModalMixin = { 73 componentDidMount: function() { 74 $(this.getDOMNode()).modal({background: true, keyboard: true, show: false}); 75 }, 76 componentWillUnmount: function() { 77 $(this.getDOMNode()).off('hidden'); 78 }, 79 handleClick: function(e) { 80 e.stopPropagation(); 81 }, 82 renderModal: function(title, content) { 83 return ( 84 <div onClick={this.handleClick} className="modal fade" role="dialog" aria-hidden="true"> 85 <div className="modal-dialog"> 86 <div className="modal-content"> 87 <div className="modal-header"> 88 <button type="button" className="close" data-dismiss="modal"> 89 <span aria-hidden="true">×</span> 90 <span className="sr-only">Close</span> 91 </button> 92 <h2 className="modal-title">{title}</h2> 93 </div> 94 <div className="modal-body"> 95 {content} 96 </div> 97 <div className="modal-footer"> 98 <button type="button" className="btn btn-default" data-dismiss="modal">Close</button> 99 </div> 100 </div> 101 </div> 102 </div> 103 ); 104 } 105 }; 106 107 72 108 window.MyReact.Modal = React.createClass({ 73 109 propTypes: { 74 title: PT. string.isRequired,110 title: PT.object.isRequired, 75 111 }, 76 112 componentDidMount: function() { … … 203 239 render: function() { 204 240 var chevron = "glyphicon glyphicon-chevron-" + (this.state.open ? "down":"right"); 205 var chevronStyle = {fontSize:12};206 var right = {float:"right"};207 241 return <div className="bs-callout bs-callout-info"> 208 242 <div className="panel"> 209 243 <div className="panel-heading unselectable row" onClick={this.toggleState}> 210 244 <div className="panel-title unselectable col-sm-11"> 211 <span className={chevron} style={ chevronStyle} /> 245 <span className={chevron} style={{fontSize:12}} /> 212 246 {this.props.title} 213 247 </div> 214 <div style={right}>248 <div className='float-right'> 215 249 {this.props.info} 216 250 </div>
Note: See TracChangeset
for help on using the changeset viewer.