mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 15:47:55 +01:00
Fix drag issue that leaves editor open
This commit is contained in:
parent
0fe100222f
commit
df6edba21b
@ -254,26 +254,17 @@ class MultilineTextEditor extends Events {
|
|||||||
|
|
||||||
close(update: boolean): void {
|
close(update: boolean): void {
|
||||||
if (this.isVisible() && this._topic) {
|
if (this.isVisible() && this._topic) {
|
||||||
if (!$defined(update) || update) {
|
const actionDispatcher = ActionDispatcher.getInstance();
|
||||||
const actionDispatcher = ActionDispatcher.getInstance();
|
this._updateModel();
|
||||||
// Workaround. For some reason, close is triggered but the topic has been removed. Temporally, try to validate if exits.
|
|
||||||
try {
|
|
||||||
actionDispatcher
|
|
||||||
.getCommandContext()
|
|
||||||
.findTopics([this._topic.getId()]);
|
|
||||||
this._updateModel();
|
|
||||||
|
|
||||||
// Let make the visible text in the node ...
|
|
||||||
this._topic.getTextShape().setVisibility(true);
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
// Remove it form the screen ...
|
|
||||||
this._containerElem.remove();
|
|
||||||
this._containerElem = null;
|
|
||||||
}
|
|
||||||
this._topic = null;
|
|
||||||
}
|
}
|
||||||
|
// Let make the visible text in the node ...
|
||||||
|
this._topic.getTextShape().setVisibility(true);
|
||||||
|
|
||||||
|
// Remove it form the screen ...
|
||||||
|
this._containerElem.remove();
|
||||||
|
this._containerElem = null;
|
||||||
|
this._topic = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
export default MultilineTextEditor;
|
export default MultilineTextEditor;
|
||||||
|
Loading…
Reference in New Issue
Block a user