Skip to content

Commit

Permalink
[changed] Removed collapsable deprecated functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKVal committed May 26, 2015
1 parent efd44d0 commit fd24317
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 488 deletions.
40 changes: 0 additions & 40 deletions src/CollapsableMixin.js

This file was deleted.

18 changes: 0 additions & 18 deletions src/CollapsableNav.js

This file was deleted.

10 changes: 0 additions & 10 deletions src/CollapsibleMixin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import TransitionEvents from './utils/TransitionEvents';
import deprecationWarning from './utils/deprecationWarning';

const CollapsibleMixin = {

Expand Down Expand Up @@ -138,15 +137,6 @@ const CollapsibleMixin = {
},

dimension(){
if (typeof this.getCollapsableDimension === 'function') {
deprecationWarning(
'CollapsableMixin.getCollapsableDimension()',
'CollapsibleMixin.getCollapsibleDimension()',
'https://github.com/react-bootstrap/react-bootstrap/issues/425#issuecomment-97110963'
);
return this.getCollapsableDimension();
}

return (typeof this.getCollapsibleDimension === 'function') ?
this.getCollapsibleDimension() :
'height';
Expand Down
19 changes: 5 additions & 14 deletions src/CollapsibleNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ import BootstrapMixin from './BootstrapMixin';
import CollapsibleMixin from './CollapsibleMixin';
import classNames from 'classnames';
import domUtils from './utils/domUtils';
import collapsable from './utils/deprecatedProperty';

import ValidComponentChildren from './utils/ValidComponentChildren';
import createChainedFunction from './utils/createChainedFunction';

const specCollapsibleNav = {
const CollapsibleNav = React.createClass({
mixins: [BootstrapMixin, CollapsibleMixin],

propTypes: {
onSelect: React.PropTypes.func,
activeHref: React.PropTypes.string,
activeKey: React.PropTypes.any,
collapsable,
collapsible: React.PropTypes.bool,
expanded: React.PropTypes.bool,
eventKey: React.PropTypes.any
Expand Down Expand Up @@ -48,16 +46,12 @@ const specCollapsibleNav = {
/*
* this.props.collapsible is set in NavBar when an eventKey is supplied.
*/
const collapsible = this.props.collapsible || this.props.collapsable;
let classes = collapsible ? this.getCollapsibleClassSet('navbar-collapse') : null;
const classes = this.props.collapsible ? this.getCollapsibleClassSet('navbar-collapse') : null;
const renderChildren = this.props.collapsible ? this.renderCollapsibleNavChildren : this.renderChildren;

return (
<div eventKey={this.props.eventKey} className={classNames(this.props.className, classes)} >
{ValidComponentChildren.map(this.props.children,
collapsible ?
this.renderCollapsibleNavChildren :
this.renderChildren
)}
{ValidComponentChildren.map(this.props.children, renderChildren)}
</div>
);
},
Expand Down Expand Up @@ -109,9 +103,6 @@ const specCollapsibleNav = {
}
);
}
};

const CollapsibleNav = React.createClass(specCollapsibleNav);
CollapsibleNav._spec = specCollapsibleNav;
});

export default CollapsibleNav;
11 changes: 3 additions & 8 deletions src/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import BootstrapMixin from './BootstrapMixin';
import CollapsibleMixin from './CollapsibleMixin';
import classNames from 'classnames';
import domUtils from './utils/domUtils';
import collapsable from './utils/deprecatedProperty';

import ValidComponentChildren from './utils/ValidComponentChildren';
import createChainedFunction from './utils/createChainedFunction';
Expand All @@ -18,7 +17,6 @@ const Nav = React.createClass({
stacked: React.PropTypes.bool,
justified: React.PropTypes.bool,
onSelect: React.PropTypes.func,
collapsable,
collapsible: React.PropTypes.bool,
expanded: React.PropTypes.bool,
navbar: React.PropTypes.bool,
Expand Down Expand Up @@ -46,12 +44,9 @@ const Nav = React.createClass({
},

render() {
const collapsible = this.props.collapsible || this.props.collapsable;
let classes = collapsible ? this.getCollapsibleClassSet() : {};
const classes = this.props.collapsible ? this.getCollapsibleClassSet('navbar-collapse') : null;

classes['navbar-collapse'] = collapsible;

if (this.props.navbar && !collapsible) {
if (this.props.navbar && !this.props.collapsible) {
return (this.renderUl());
}

Expand All @@ -63,7 +58,7 @@ const Nav = React.createClass({
},

renderUl() {
let classes = this.getBsClassSet();
const classes = this.getBsClassSet();

classes['nav-stacked'] = this.props.stacked;
classes['nav-justified'] = this.props.justified;
Expand Down
22 changes: 8 additions & 14 deletions src/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import classNames from 'classnames';

import BootstrapMixin from './BootstrapMixin';
import CollapsibleMixin from './CollapsibleMixin';
import collapsable from './utils/deprecatedProperty';

const Panel = React.createClass({
mixins: [BootstrapMixin, CollapsibleMixin],

propTypes: {
collapsable,
collapsible: React.PropTypes.bool,
onSelect: React.PropTypes.func,
header: React.PropTypes.node,
Expand Down Expand Up @@ -56,21 +54,18 @@ const Panel = React.createClass({
},

render() {
let classes = this.getBsClassSet();
const collapsible = this.props.collapsible || this.props.collapsable;

return (
<div {...this.props}
className={classNames(this.props.className, classes)}
id={collapsible ? null : this.props.id} onSelect={null}>
className={classNames(this.props.className, this.getBsClassSet())}
id={this.props.collapsible ? null : this.props.id} onSelect={null}>
{this.renderHeading()}
{collapsible ? this.renderCollapsableBody() : this.renderBody()}
{this.props.collapsible ? this.renderCollapsibleBody() : this.renderBody()}
{this.renderFooter()}
</div>
);
},

renderCollapsableBody() {
renderCollapsibleBody() {
let collapseClass = this.prefixClass('collapse');

return (
Expand Down Expand Up @@ -147,21 +142,20 @@ const Panel = React.createClass({

renderHeading() {
let header = this.props.header;
const collapsible = this.props.collapsible || this.props.collapsable;

if (!header) {
return null;
}

if (!React.isValidElement(header) || Array.isArray(header)) {
header = collapsible ?
this.renderCollapsableTitle(header) : header;
header = this.props.collapsible ?
this.renderCollapsibleTitle(header) : header;
} else {
const className = classNames(
this.prefixClass('title'), header.props.className
);

if (collapsible) {
if (this.props.collapsible) {
header = cloneElement(header, {
className,
children: this.renderAnchor(header.props.children)
Expand Down Expand Up @@ -190,7 +184,7 @@ const Panel = React.createClass({
);
},

renderCollapsableTitle(header) {
renderCollapsibleTitle(header) {
return (
<h4 className={this.prefixClass('title')}>
{this.renderAnchor(header)}
Expand Down
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import Button from './Button';
import ButtonGroup from './ButtonGroup';
import ButtonInput from './ButtonInput';
import ButtonToolbar from './ButtonToolbar';
import CollapsableNav from './CollapsableNav';
import CollapsibleNav from './CollapsibleNav';
import Carousel from './Carousel';
import CarouselItem from './CarouselItem';
import Col from './Col';
import CollapsableMixin from './CollapsableMixin';
import CollapsibleMixin from './CollapsibleMixin';
import DropdownButton from './DropdownButton';
import DropdownMenu from './DropdownMenu';
Expand Down Expand Up @@ -64,12 +62,10 @@ export default {
ButtonGroup,
ButtonInput,
ButtonToolbar,
CollapsableNav,
CollapsibleNav,
Carousel,
CarouselItem,
Col,
CollapsableMixin,
CollapsibleMixin,
DropdownButton,
DropdownMenu,
Expand Down
13 changes: 0 additions & 13 deletions src/utils/deprecatedProperty.js

This file was deleted.

Loading

0 comments on commit fd24317

Please sign in to comment.