Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
clearTimeout(timeout);
CSSCore.removeClass(node, className);
CSSCore.removeClass(node, activeClassName);
// Usually this optional callback is used for informing an owner of
// a leave animation and telling it to remove the child.
if (finishCallback) {
finishCallback();
}
};
CSSCore.addClass(node, className);
// Need to do this to actually trigger a transition.
this.queueClassAndNode(activeClassName, node);
// If the user specified a timeout delay.
if (userSpecifiedDelay) {
// Clean-up the animation after the specified delay
timeout = setTimeout(endListener, userSpecifiedDelay);
this.transitionTimeouts.push(timeout);
}
}
return;
}
clearTimeout(timeout);
removeClass(node, className);
removeClass(node, activeClassName);
// Usually this optional callback is used for informing an owner of
// a leave animation and telling it to remove the child.
if (finishCallback) {
finishCallback();
}
};
addClass(node, className);
// Need to do this to actually trigger a transition.
this.queueClass(activeClassName);
// Clean-up the animation after the specified delay
const timeout = setTimeout(endListener, userSpecifiedDelay);
this.transitionTimeouts.push(timeout);
};
clearTimeout(timeout);
CSSCore.removeClass(node, className);
CSSCore.removeClass(node, activeClassName);
ReactTransitionEvents.removeEndEventListener(node, endListener);
// Usually this optional callback is used for informing an owner of
// a leave animation and telling it to remove the child.
if (finishCallback) {
finishCallback();
}
};
CSSCore.addClass(node, className);
// Need to do this to actually trigger a transition.
this.queueClass(activeClassName);
// If the user specified a timeout delay.
if (userSpecifiedDelay) {
// Clean-up the animation after the specified delay
timeout = setTimeout(endListener, userSpecifiedDelay);
this.transitionTimeouts.push(timeout);
} else {
// DEPRECATED: this listener will be removed in a future version of react
ReactTransitionEvents.addEndEventListener(node, endListener);
}
},
clearTimeout(timeout);
CSSCore.removeClass(node, className);
CSSCore.removeClass(node, activeClassName);
ReactTransitionEvents.removeEndEventListener(node, endListener);
// Usually this optional callback is used for informing an owner of
// a leave animation and telling it to remove the child.
if (finishCallback) {
finishCallback();
}
};
CSSCore.addClass(node, className);
// Need to do this to actually trigger a transition.
_this.queueClassAndNode(activeClassName, node);
// If the user specified a timeout delay.
if (userSpecifiedDelay) {
// Clean-up the animation after the specified delay
timeout = setTimeout(endListener, userSpecifiedDelay);
_this.transitionTimeouts.push(timeout);
} else {
// DEPRECATED: this listener will be removed in a future version of react
ReactTransitionEvents.addEndEventListener(node, endListener);
}
}, _this.queueClassAndNode = function (className, node) {
_this.classNameAndNodeQueue.push({
_setTransition = (add) => {
const body = document.querySelector('body');
if (add) {
this.isHiding = false;
CSSCore.addClass(body, 'toastr-confirm-active');
CSSCore.addClass(this.confirm, 'bounceInDown');
return;
}
this.isHiding = true;
CSSCore.addClass(this.confirm, 'bounceOutUp');
};
this.classNameAndNodeQueue.forEach(function(obj) {
CSSCore.addClass(obj.node, obj.className);
});
}
_setTransition = (hide) => {
const node = this.toastrBox;
const animationType = hide ? this.transitionOut : this.transitionIn;
const onEndListener = (e) => {
if (e && e.target == node) {
CSSCore.removeClass(node, animationType);
}
};
onCSSTransitionEnd(this.toastrBox, onEndListener);
CSSCore.addClass(node, animationType);
};
_setTransition = (add) => {
const body = document.querySelector('body');
if (add) {
this.isHiding = false;
CSSCore.addClass(body, 'toastr-confirm-active');
CSSCore.addClass(this.confirm, 'bounceInDown');
return;
}
this.isHiding = true;
CSSCore.addClass(this.confirm, 'bounceOutUp');
};
handleClick(e) {
e.preventDefault();
CSSCore.addClass(this.toastrButton, 'active');
/*
* In order to avoid event bubbling we need to call the onClick callback
* after we have remove the css class 'active' that contains the animation
*/
const end = () => {
CSSCore.removeClass(this.toastrButton, 'active');
if (this.props.onClick) {
this.props.onClick && this.props.onClick();
}
};
onCSSTransitionEnd(this.toastrButton, end);
}