undo unneeded changes
This commit is contained in:
parent
c6952ba5b6
commit
c9272c48e0
3 changed files with 1 additions and 21 deletions
|
@ -72,16 +72,12 @@ export default class MainSplit extends React.Component {
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
const shouldAllowResizing =
|
const shouldAllowResizing =
|
||||||
!this.props.disableSizing &&
|
|
||||||
!this.props.collapsedRhs &&
|
!this.props.collapsedRhs &&
|
||||||
this.props.panel;
|
this.props.panel;
|
||||||
|
|
||||||
if (shouldAllowResizing && !this.resizer) {
|
if (shouldAllowResizing && !this.resizer) {
|
||||||
this._createResizer();
|
this._createResizer();
|
||||||
} else if (!shouldAllowResizing && this.resizer) {
|
} else if (!shouldAllowResizing && this.resizer) {
|
||||||
if (this.props.disableSizing) {
|
|
||||||
this.resizer.clearItemSizes();
|
|
||||||
}
|
|
||||||
this.resizer.detach();
|
this.resizer.detach();
|
||||||
this.resizer = null;
|
this.resizer = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,14 +43,6 @@ export class Resizer {
|
||||||
this._onMouseDown = this._onMouseDown.bind(this);
|
this._onMouseDown = this._onMouseDown.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
clearItemSizes() {
|
|
||||||
const handles = this._getResizeHandles();
|
|
||||||
handles.forEach((handle) => {
|
|
||||||
const {sizer, item} = this._createSizerAndDistributor(handle);
|
|
||||||
sizer.clearItemSize(item);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
setClassNames(classNames) {
|
setClassNames(classNames) {
|
||||||
this.classNames = classNames;
|
this.classNames = classNames;
|
||||||
}
|
}
|
||||||
|
@ -142,7 +134,7 @@ export class Resizer {
|
||||||
const distributor = new this.distributorCtor(
|
const distributor = new this.distributorCtor(
|
||||||
sizer, item, id, this.distributorCfg,
|
sizer, item, id, this.distributorCfg,
|
||||||
items, this.container);
|
items, this.container);
|
||||||
return {sizer, distributor, item};
|
return {sizer, distributor};
|
||||||
}
|
}
|
||||||
|
|
||||||
_getResizableItems() {
|
_getResizableItems() {
|
||||||
|
|
|
@ -82,14 +82,6 @@ class Sizer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clearItemSize(item, size) {
|
|
||||||
if (this.vertical) {
|
|
||||||
item.style.height = null;
|
|
||||||
} else {
|
|
||||||
item.style.width = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@param {MouseEvent} event the mouse event
|
@param {MouseEvent} event the mouse event
|
||||||
@return {number} the distance between the cursor and the edge of the container,
|
@return {number} the distance between the cursor and the edge of the container,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue