Skip to content
Snippets Groups Projects
Commit 5c9cab14 authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

Fixed context not working

parent fadcd1c6
No related branches found
No related tags found
No related merge requests found
Pipeline #52763 passed
import jQuery from "jquery";
import { Graph } from "../../graph";
import { CONTEXT } from "../../state";
import { state } from "../editor";
import { state } from "../../editor";
import ToolMenu from "./toolmenu";
export const COLLECTION_KEY = "collection";
......@@ -68,18 +68,24 @@ export class CollectMenu extends ToolMenu {
}
// Disable previous context
if (this.context !== undefined) {
this.getDomToContext(this.context).addClass(HIDDEN_CLASS);
var dom = this.getDomToContext(this.context);
if (dom !== undefined) {
dom.addClass(HIDDEN_CLASS);
}
// Store and activate new context
this.context = context;
if (this.context !== undefined) {
this.getDomToContext(this.context).removeClass(HIDDEN_CLASS);
dom = this.getDomToContext(this.context);
if (dom !== undefined) {
dom.removeClass(HIDDEN_CLASS);
}
}
getDomToContext(context) {
if (context === undefined) {
return undefined;
}
if (context === CONTEXT.node) {
return this.find(CONTEXT_NODE);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment