@r365/react-calendar-timeline
Advanced tools
Comparing version 0.25.0-beta.11 to 0.25.0-beta.12
@@ -383,3 +383,2 @@ 'use strict'; | ||
this.cacheDataFromProps(this.props); | ||
var interactMounted = this.state.interactMounted; | ||
@@ -394,24 +393,30 @@ | ||
if (this.props.selected && !interactMounted && !!this.item) { | ||
this.mountInteract(); | ||
interactMounted = true; | ||
} | ||
if (!!this.item) { | ||
if (this.props.selected && !interactMounted) { | ||
this.mountInteract(); | ||
interactMounted = true; | ||
} | ||
if (interactMounted && (couldResizeLeft !== willBeAbleToResizeLeft || couldResizeRight !== willBeAbleToResizeRight)) { | ||
var leftResize = this.props.useResizeHandle ? this.dragLeft : true; | ||
var rightResize = this.props.useResizeHandle ? this.dragRight : true; | ||
if (interactMounted && !!this.item && (couldResizeLeft !== willBeAbleToResizeLeft || couldResizeRight !== willBeAbleToResizeRight)) { | ||
var leftResize = this.props.useResizeHandle ? this.dragLeft : true; | ||
var rightResize = this.props.useResizeHandle ? this.dragRight : true; | ||
(0, _interactjs2.default)(this.item).resizable({ | ||
enabled: willBeAbleToResizeLeft || willBeAbleToResizeRight, | ||
edges: { | ||
top: false, | ||
bottom: false, | ||
left: willBeAbleToResizeLeft && leftResize, | ||
right: willBeAbleToResizeRight && rightResize | ||
} | ||
}); | ||
(0, _interactjs2.default)(this.item).resizable({ | ||
enabled: willBeAbleToResizeLeft || willBeAbleToResizeRight, | ||
edges: { | ||
top: false, | ||
bottom: false, | ||
left: willBeAbleToResizeLeft && leftResize, | ||
right: willBeAbleToResizeRight && rightResize | ||
} | ||
}); | ||
} | ||
if (interactMounted && couldDrag !== willBeAbleToDrag) { | ||
(0, _interactjs2.default)(this.item).draggable({ enabled: willBeAbleToDrag }); | ||
} | ||
} else { | ||
interactMounted = false; | ||
} | ||
if (interactMounted && !!this.item && couldDrag !== willBeAbleToDrag) { | ||
(0, _interactjs2.default)(this.item).draggable({ enabled: willBeAbleToDrag }); | ||
} | ||
this.setState({ | ||
interactMounted: interactMounted | ||
}); | ||
} | ||
@@ -418,0 +423,0 @@ }, { |
{ | ||
"name": "@r365/react-calendar-timeline", | ||
"version": "0.25.0-beta.11", | ||
"version": "0.25.0-beta.12", | ||
"description": "react calendar timeline", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -417,3 +417,2 @@ import { Component } from 'react' | ||
this.cacheDataFromProps(this.props) | ||
let { interactMounted } = this.state | ||
@@ -431,28 +430,36 @@ const couldDrag = prevProps.selected && this.canMove(prevProps) | ||
if (this.props.selected && !interactMounted && !!this.item) { | ||
this.mountInteract() | ||
interactMounted = true | ||
if(!!this.item){ | ||
if (this.props.selected && !interactMounted) { | ||
this.mountInteract() | ||
interactMounted = true | ||
} | ||
if ( | ||
interactMounted && | ||
(couldResizeLeft !== willBeAbleToResizeLeft || | ||
couldResizeRight !== willBeAbleToResizeRight) | ||
) { | ||
const leftResize = this.props.useResizeHandle ? this.dragLeft : true | ||
const rightResize = this.props.useResizeHandle ? this.dragRight : true | ||
interact(this.item).resizable({ | ||
enabled: willBeAbleToResizeLeft || willBeAbleToResizeRight, | ||
edges: { | ||
top: false, | ||
bottom: false, | ||
left: willBeAbleToResizeLeft && leftResize, | ||
right: willBeAbleToResizeRight && rightResize | ||
} | ||
}) | ||
} | ||
if (interactMounted && couldDrag !== willBeAbleToDrag) { | ||
interact(this.item).draggable({ enabled: willBeAbleToDrag }) | ||
} | ||
} | ||
else{ | ||
interactMounted= false; | ||
} | ||
this.setState({ | ||
interactMounted, | ||
}) | ||
if ( | ||
interactMounted && !!this.item && | ||
(couldResizeLeft !== willBeAbleToResizeLeft || | ||
couldResizeRight !== willBeAbleToResizeRight) | ||
) { | ||
const leftResize = this.props.useResizeHandle ? this.dragLeft : true | ||
const rightResize = this.props.useResizeHandle ? this.dragRight : true | ||
interact(this.item).resizable({ | ||
enabled: willBeAbleToResizeLeft || willBeAbleToResizeRight, | ||
edges: { | ||
top: false, | ||
bottom: false, | ||
left: willBeAbleToResizeLeft && leftResize, | ||
right: willBeAbleToResizeRight && rightResize | ||
} | ||
}) | ||
} | ||
if (interactMounted && !!this.item && couldDrag !== willBeAbleToDrag) { | ||
interact(this.item).draggable({ enabled: willBeAbleToDrag }) | ||
} | ||
} | ||
@@ -459,0 +466,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
469733
9978