From 1b6545fa653df44b019f6676faed39880999b2bf Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 21 Aug 2017 12:08:41 +0200 Subject: Add basic react-konva rendering prototype --- src/components/modals/Modal.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/components/modals/Modal.js') 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() { -- cgit v1.2.3