Commit fb12369c authored by Themousaillon's avatar Themousaillon

fix graph interactions & renaming bug

parent d520b697
......@@ -623,10 +623,11 @@ module.exports = function () {
Frame.prototype.contextualMenuAction = function(action){
// console.log(this.currentView);
const graphActions = ["rename", "clone", "list", "freeze", "unfreeze", null]
let multi = action.split(':').length > 1;
let union = !(action.split(':')[1] == 'intersection');
action = action.split(':')[0];
if ((this.currentNode!=null || this.currentNodes.length > 0) && action!=null) {
if ((this.currentNode!=null || this.currentNodes.length > 0) && !graphActions.includes(action)) {
if (action == "supernodes") {
let supernodesManager = SupernodesManager.getInstance();
......@@ -705,9 +706,10 @@ module.exports = function () {
}
if(action=="rename") {
let viewId = this.scenemanager._groupViews.children.indexOf(this.transformControl.object);
let graphName = this.intergraph.graphs()[viewId].title();
alert.textarea("Rename graph", graphName.replace(/\|/g,'\n')).then((name) => {
graphName = name.replace(/\|/g, '').replace(/\n/g, '|') // replace '|' with utf-8 lookalike to hide the ugly truth from the user
let [graphName, entries] = this.intergraph.graphs()[viewId].title().split(/\|/g);
alert.textarea("Rename graph", graphName).then((name) => {
graphName = name + "|" + entries
this.intergraph.graphs()[viewId].setTitle(graphName);
this.scenemanager.updateViewTexture(viewId);
this.update();
......@@ -725,9 +727,9 @@ module.exports = function () {
}
if(action=="rename") {
let viewId = this.scenemanager._groupViews.children.indexOf(this.hoverView);
let graphName = this.intergraph.graphs()[viewId].title();
alert.textarea("Rename graph", graphName.replace(/\|/g,'\n')).then((name) => {
graphName = name.replace(/\|/g, '').replace(/\n/g, '|') // replace '|' with utf-8 lookalike to hide the ugly truth from the user
let [graphName, entries] = this.intergraph.graphs()[viewId].title().split(/\|/g);
alert.textarea("Rename graph", graphName).then((name) => {
graphName = name + "|" + entries
this.intergraph.graphs()[viewId].setTitle(graphName);
this.scenemanager.updateViewTexture(viewId);
this.update();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment