Removed Modal base class
Этот коммит содержится в:
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
var Modal = require('./modal.jsx');
|
var Modal = ReactBootstrap.Modal;
|
||||||
var UserStore = require('../stores/user_store.jsx');
|
var UserStore = require('../stores/user_store.jsx');
|
||||||
var ChannelStore = require('../stores/channel_store.jsx');
|
var ChannelStore = require('../stores/channel_store.jsx');
|
||||||
var AsyncClient = require('../utils/async_client.jsx');
|
var AsyncClient = require('../utils/async_client.jsx');
|
||||||
@@ -43,6 +43,15 @@ export default class AccessHistoryModal extends React.Component {
|
|||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserStore.addAuditsChangeListener(this.onAuditChange);
|
UserStore.addAuditsChangeListener(this.onAuditChange);
|
||||||
|
|
||||||
|
if (this.props.show) {
|
||||||
|
this.onShow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
componentDidUpdate(prevProps) {
|
||||||
|
if (this.props.show && !prevProps.show) {
|
||||||
|
this.onShow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
UserStore.removeAuditsChangeListener(this.onAuditChange);
|
UserStore.removeAuditsChangeListener(this.onAuditChange);
|
||||||
@@ -386,7 +395,6 @@ export default class AccessHistoryModal extends React.Component {
|
|||||||
<Modal
|
<Modal
|
||||||
show={this.props.show}
|
show={this.props.show}
|
||||||
onHide={this.onHide}
|
onHide={this.onHide}
|
||||||
onShow={this.onShow}
|
|
||||||
bsSize='large'
|
bsSize='large'
|
||||||
>
|
>
|
||||||
<Modal.Header closeButton={true}>
|
<Modal.Header closeButton={true}>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
const UserStore = require('../stores/user_store.jsx');
|
const UserStore = require('../stores/user_store.jsx');
|
||||||
const Client = require('../utils/client.jsx');
|
const Client = require('../utils/client.jsx');
|
||||||
const AsyncClient = require('../utils/async_client.jsx');
|
const AsyncClient = require('../utils/async_client.jsx');
|
||||||
const Modal = require('./modal.jsx');
|
const Modal = ReactBootstrap.Modal;
|
||||||
const LoadingScreen = require('./loading_screen.jsx');
|
const LoadingScreen = require('./loading_screen.jsx');
|
||||||
const Utils = require('../utils/utils.jsx');
|
const Utils = require('../utils/utils.jsx');
|
||||||
|
|
||||||
@@ -62,6 +62,15 @@ export default class ActivityLogModal extends React.Component {
|
|||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
UserStore.addSessionsChangeListener(this.onListenerChange);
|
UserStore.addSessionsChangeListener(this.onListenerChange);
|
||||||
|
|
||||||
|
if (this.props.show) {
|
||||||
|
this.onShow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
componentDidUpdate(prevProps) {
|
||||||
|
if (this.props.show && !prevProps.show) {
|
||||||
|
this.onShow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
UserStore.removeSessionsChangeListener(this.onListenerChange);
|
UserStore.removeSessionsChangeListener(this.onListenerChange);
|
||||||
@@ -156,7 +165,6 @@ export default class ActivityLogModal extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
show={this.props.show}
|
show={this.props.show}
|
||||||
onShow={this.onShow}
|
|
||||||
onHide={this.onHide}
|
onHide={this.onHide}
|
||||||
bsSize='large'
|
bsSize='large'
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
const Modal = require('./modal.jsx');
|
const Modal = ReactBootstrap.Modal;
|
||||||
|
|
||||||
export default class ChannelInfoModal extends React.Component {
|
export default class ChannelInfoModal extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
@@ -18,7 +18,6 @@ export default class ChannelInfoModal extends React.Component {
|
|||||||
<Modal
|
<Modal
|
||||||
show={this.props.show}
|
show={this.props.show}
|
||||||
onHide={this.props.onHide}
|
onHide={this.props.onHide}
|
||||||
onShow={this.onShow}
|
|
||||||
>
|
>
|
||||||
<Modal.Header closeButtton={true}>
|
<Modal.Header closeButtton={true}>
|
||||||
{channel.display_name}
|
{channel.display_name}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
var Modal = require('./modal.jsx');
|
var Modal = ReactBootstrap.Modal;
|
||||||
var SettingItemMin = require('./setting_item_min.jsx');
|
var SettingItemMin = require('./setting_item_min.jsx');
|
||||||
var SettingItemMax = require('./setting_item_max.jsx');
|
var SettingItemMax = require('./setting_item_max.jsx');
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
const Modal = require('./modal.jsx');
|
const Modal = ReactBootstrap.Modal;
|
||||||
|
|
||||||
export default class ConfirmModal extends React.Component {
|
export default class ConfirmModal extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
const AsyncClient = require('../utils/async_client.jsx');
|
const AsyncClient = require('../utils/async_client.jsx');
|
||||||
const Client = require('../utils/client.jsx');
|
const Client = require('../utils/client.jsx');
|
||||||
const Modal = require('./modal.jsx');
|
const Modal = ReactBootstrap.Modal;
|
||||||
const TeamStore = require('../stores/team_store.jsx');
|
const TeamStore = require('../stores/team_store.jsx');
|
||||||
const Utils = require('../utils/utils.jsx');
|
const Utils = require('../utils/utils.jsx');
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
|
||||||
// See License.txt for license information.
|
|
||||||
|
|
||||||
export default class Modal extends ReactBootstrap.Modal {
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillMount() {
|
|
||||||
if (this.props.show && this.props.onPreshow) {
|
|
||||||
this.props.onPreshow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
super.componentDidMount();
|
|
||||||
|
|
||||||
if (this.props.show && this.props.onShow) {
|
|
||||||
this.props.onShow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
|
||||||
super.componentDidUpdate(prevProps);
|
|
||||||
|
|
||||||
if (this.props.show && !prevProps.show && this.props.onShow) {
|
|
||||||
this.props.onShow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
|
||||||
super.componentWillReceiveProps(nextProps);
|
|
||||||
|
|
||||||
if (nextProps.show && !this.props.show && this.props.onPreshow) {
|
|
||||||
this.props.onPreshow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Modal.propTypes = {
|
|
||||||
...ReactBootstrap.Modal.propTypes,
|
|
||||||
|
|
||||||
// called before showing the dialog to allow for a state change before rendering
|
|
||||||
onPreshow: React.PropTypes.func,
|
|
||||||
|
|
||||||
// called after the dialog has been shown and rendered
|
|
||||||
onShow: React.PropTypes.func
|
|
||||||
};
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
const ConfirmModal = require('../confirm_modal.jsx');
|
const ConfirmModal = require('../confirm_modal.jsx');
|
||||||
const Modal = require('../modal.jsx');
|
const Modal = ReactBootstrap.Modal;
|
||||||
const SettingsSidebar = require('../settings_sidebar.jsx');
|
const SettingsSidebar = require('../settings_sidebar.jsx');
|
||||||
const UserSettings = require('./user_settings.jsx');
|
const UserSettings = require('./user_settings.jsx');
|
||||||
|
|
||||||
@@ -34,6 +34,18 @@ export default class UserSettingsModal extends React.Component {
|
|||||||
this.requireConfirm = false;
|
this.requireConfirm = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
if (this.props.show) {
|
||||||
|
this.handleShow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidUpdate(prevProps) {
|
||||||
|
if (this.props.show && !prevProps.show) {
|
||||||
|
this.handleShow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handleShow() {
|
handleShow() {
|
||||||
$(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 300);
|
$(ReactDOM.findDOMNode(this.refs.modalBody)).css('max-height', $(window).height() - 300);
|
||||||
if ($(window).width() > 768) {
|
if ($(window).width() > 768) {
|
||||||
@@ -175,7 +187,6 @@ export default class UserSettingsModal extends React.Component {
|
|||||||
<Modal
|
<Modal
|
||||||
dialogClassName='settings-modal'
|
dialogClassName='settings-modal'
|
||||||
show={this.props.show}
|
show={this.props.show}
|
||||||
onShow={this.handleShow}
|
|
||||||
onHide={this.handleHide}
|
onHide={this.handleHide}
|
||||||
onExited={this.handleHidden}
|
onExited={this.handleHidden}
|
||||||
enforceFocus={this.state.enforceFocus}
|
enforceFocus={this.state.enforceFocus}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user