Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ihh committed Apr 26, 2019
1 parent de75c2f commit 21de496
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lambda/app/src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { Bracery, ParseTree } from 'bracery';
import braceryWeb, { extend, defaultUserName } from './bracery-web';
import braceryWeb, { extend } from './bracery-web';
import RiTa from 'rita';
import marked from 'marked';
import DebouncePromise from 'awesome-debounce-promise';
Expand Down Expand Up @@ -334,7 +334,7 @@ class App extends Component {

getSymbol (config) {
return this.getBracery (config.symbolName
|| ((config.node.user || config.defaultUser || defaultUserName) + '/' + config.node.name))
|| ((config.node.user || config.defaultUser || this.ParseTree.defaultUser) + '/' + config.node.name))
.then ((bracery) => [bracery]);
}
setSymbol() { return []; }
Expand Down
5 changes: 4 additions & 1 deletion lambda/app/src/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ class MapView extends Component {

graphStateForSelection (selected) {
this.graph.selected = selected; // setter automatically updates graph selection markers
return extend ({ renamerContent: '' },
return extend ({ renamerContent: '',
renamerDisabled: false },
this.graphState(),
this.graph.getEditorState());
}
Expand All @@ -77,6 +78,8 @@ class MapView extends Component {

// setRenamerState is called by the (tightly-controlled) rename input, to update its own state
setRenamerState (newRenamerState) {
if (newRenamerState.content)
newRenamerState.content = newRenamerState.content.toLowerCase().replace(/\s/g,'_').replace(/[^a-z0-9_]/g,'');
const newState = this.prependInputName (newRenamerState, 'renamer');
this.setState (newState);
}
Expand Down

0 comments on commit 21de496

Please sign in to comment.