summaryrefslogtreecommitdiff
path: root/src/components/modals
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/modals')
-rw-r--r--src/components/modals/Modal.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/components/modals/Modal.js b/src/components/modals/Modal.js
index 06273a46..193746b3 100644
--- a/src/components/modals/Modal.js
+++ b/src/components/modals/Modal.js
@@ -1,6 +1,7 @@
import classNames from "classnames";
import PropTypes from "prop-types";
import React from "react";
+import jQuery from "../../util/jquery";
class Modal extends React.Component {
static propTypes = {
@@ -33,15 +34,15 @@ class Modal extends React.Component {
this.openOrCloseModal();
// Trigger auto-focus
- window["$"]("#" + this.id).on("shown.bs.modal", function () {
- window["$"](this).find("input").first().focus();
- });
-
- window["$"]("#" + this.id).on("hide.bs.modal", () => {
- if (this.visible) {
- this.props.onCancel();
- }
- });
+ jQuery("#" + this.id)
+ .on("shown.bs.modal", function () {
+ jQuery(this).find("input").first().focus();
+ })
+ .on("hide.bs.modal", () => {
+ if (this.visible) {
+ this.props.onCancel();
+ }
+ });
}
componentDidUpdate() {
@@ -66,11 +67,11 @@ class Modal extends React.Component {
}
openModal() {
- window["$"]("#" + this.id).modal("show");
+ jQuery("#" + this.id).modal("show");
}
closeModal() {
- window["$"]("#" + this.id).modal("hide");
+ jQuery("#" + this.id).modal("hide");
}
openOrCloseModal() {