diff --git a/src/elements/AddTagPopup/AddTagPopup.js b/src/elements/AddTagPopup/AddTagPopup.js
index d6b8a5a..eeb928b 100644
--- a/src/elements/AddTagPopup/AddTagPopup.js
+++ b/src/elements/AddTagPopup/AddTagPopup.js
@@ -1,27 +1,36 @@
import React from "react";
-import Modal from 'react-bootstrap/Modal'
-import Dropdown from "react-bootstrap/Dropdown";
-import DropdownButton from "react-bootstrap/DropdownButton";
+import ReactDom from 'react-dom';
+import style from './AddTagPopup.module.css'
+import Tag from "../Tag/Tag";
+import {Line} from "../PageTitle/PageTitle";
+import GlobalInfos from "../../GlobalInfos";
/**
* component creates overlay to add a new tag to a video
*/
class AddTagPopup extends React.Component {
+ /// instance of root element
+ element;
+
constructor(props, context) {
super(props, context);
- this.state = {
- selection: {
- name: "nothing selected",
- id: -1
- },
- items: []
- };
+ this.state = {items: []};
+ this.handleClickOutside = this.handleClickOutside.bind(this);
+ this.keypress = this.keypress.bind(this);
this.props = props;
}
componentDidMount() {
+ document.addEventListener('click', this.handleClickOutside);
+ document.addEventListener('keyup', this.keypress);
+
+ // add element drag drop events
+ if (this.element != null) {
+ this.dragElement();
+ }
+
const updateRequest = new FormData();
updateRequest.append('action', 'getAllTags');
@@ -34,50 +43,62 @@ class AddTagPopup extends React.Component {
});
}
+ componentWillUnmount() {
+ // remove the appended listeners
+ document.removeEventListener('click', this.handleClickOutside);
+ document.removeEventListener('keyup', this.keypress);
+ }
+
render() {
+ const themeStyle = GlobalInfos.getThemeStyle();
return (
- <>
- Select a Tag:
-