summaryrefslogtreecommitdiff
path: root/src/components/modals/Modal.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-08-21 12:08:41 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:05:43 +0200
commit1b6545fa653df44b019f6676faed39880999b2bf (patch)
treecb131975db09cdb401b082700e2075d462495897 /src/components/modals/Modal.js
parent8a49e1eedebb6d4c47edf6fd1a7545ea502d59e7 (diff)
Add basic react-konva rendering prototype
Diffstat (limited to 'src/components/modals/Modal.js')
-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() {