<commit_before>/* global document, HTMLElement */
HTMLElement = typeof HTMLElement === 'undefined' ? function(){} : HTMLElement;

var React = require('react');
import PureRenderMixin from 'react-addons-pure-render-mixin';
var ClassMixin = require('../mixins/ClassMixin.jsx');

// TODO: This is due to a limitation of react-modal. Hopefully they fix it soon!

var ReactModal = require('react-modal');

if (typeof window !== 'undefined') {
    ReactModal.setAppElement(document.body);
    // ReactModal.injectCSS();
}

var styleReset = {
    overlay: {
        backgroundColor : null
    },
    content: {
        position                : null,
        top                     : null,
        left                    : null,
        right                   : null,
        bottom                  : null,
        border                  : null,
        background              : null,
        overflow                : null,
        WebkitOverflowScrolling : null,
        borderRadius            : null,
        outline                 : null,
        padding                 : null
    }
}

var Modal = React.createClass({
    displayName: 'Modal',
    mixins: [ClassMixin, PureRenderMixin],
    propTypes: {
        isOpen: React.PropTypes.bool.isRequired,
        onRequestClose: React.PropTypes.func,
        transitionName: React.PropTypes.oneOf(['fade', 'slide']),
        transitionDuration: React.PropTypes.number
    },
    getDefaultProps: function () {
        return {
            transitionName: 'fade',
            transitionDuration: 480
        };
    },
    getInitialState: function () {
        return {
            loaded: false
        };
    },
    render: function() {
        if (!this.state.loaded) {
            return null;
        }
        var modalClasses = this.createClassName('Modal')
            .modifier(this.props.transitionName);

        return (
            <ReactModal
                className={modalClasses.className}
                isOpen={this.props.isOpen}
                onRequestClose={this.props.onRequestClose}<commit_msg>Fix logic so modals can open<commit_after>/* global document, HTMLElement */
HTMLElement = typeof HTMLElement === 'undefined' ? function(){} : HTMLElement;

var React = require('react');
import PureRenderMixin from 'react-addons-pure-render-mixin';
var ClassMixin = require('../mixins/ClassMixin.jsx');

// TODO: This is due to a limitation of react-modal. Hopefully they fix it soon!

var ReactModal = require('react-modal');

if (typeof window !== 'undefined') {
    ReactModal.setAppElement(document.body);
    // ReactModal.injectCSS();
}

var styleReset = {
    overlay: {
        backgroundColor : null
    },
    content: {
        position                : null,
        top                     : null,
        left                    : null,
        right                   : null,
        bottom                  : null,
        border                  : null,
        background              : null,
        overflow                : null,
        WebkitOverflowScrolling : null,
        borderRadius            : null,
        outline                 : null,
        padding                 : null
    }
}

var Modal = React.createClass({
    displayName: 'Modal',
    mixins: [ClassMixin, PureRenderMixin],
    propTypes: {
        isOpen: React.PropTypes.bool.isRequired,
        onRequestClose: React.PropTypes.func,
        transitionName: React.PropTypes.oneOf(['fade', 'slide']),
        transitionDuration: React.PropTypes.number
    },
    getDefaultProps: function () {
        return {
            transitionName: 'fade',
            transitionDuration: 480
        };
    },
    getInitialState: function () {
        return {
            loaded: false
        };
    },
    render: function() {
        if (!this.state.loaded && !this.props.isOpen) {
            return null;
        }
        var modalClasses = this.createClassName('Modal')
            .modifier(this.props.transitionName);

        return (
            <ReactModal
                className={modalClasses.className}
                isOpen={this.props.isOpen}
                onRequestClose={this.props.onRequestClose}
{'fraction_non_alphanumeric': 0.1053763440860215, 'fraction_numerical': 0.0014336917562724014, 'mean_word_length': 1.6867779204107831, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1651712', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1081, 'n_words': 241}