Ignore:
Timestamp:
03/05/15 18:24:55 (9 years ago)
Author:
emanuel.dima@uni-tuebingen.de
Message:
  1. alpha 26: zoom in result, other UI changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/src/main/resources/assets/js/components.jsx

    r6049 r6081  
    7070
    7171
     72window.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">&times;</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
    72108window.MyReact.Modal = React.createClass({
    73109        propTypes: {
    74                 title: PT.string.isRequired,
     110                title: PT.object.isRequired,
    75111        },
    76112        componentDidMount: function() {
     
    203239        render: function() {
    204240                var chevron = "glyphicon glyphicon-chevron-" + (this.state.open ? "down":"right");
    205                 var chevronStyle = {fontSize:12};
    206                 var right = {float:"right"};
    207241                return  <div className="bs-callout bs-callout-info">
    208242                                        <div className="panel">
    209243                                                <div className="panel-heading unselectable row" onClick={this.toggleState}>
    210244                                                        <div className="panel-title unselectable col-sm-11">
    211                                                                 <span className={chevron} style={chevronStyle} />&nbsp;
     245                                                                <span className={chevron} style={{fontSize:12}} />&nbsp;
    212246                                                                {this.props.title}
    213247                                                        </div>
    214                                                         <div style={right}>
     248                                                        <div className='float-right'>
    215249                                                                {this.props.info}
    216250                                                        </div>
Note: See TracChangeset for help on using the changeset viewer.