Avoid root node flash.

master
Andy Stewart 6 years ago
parent 24cfad3724
commit ba6062ea41
  1. 2
      app/mindmap/buffer.py
  2. 7
      app/mindmap/index.html

@ -53,7 +53,7 @@ class AppBuffer(BrowserBuffer):
with open(self.url, "r") as f:
self.buffer_widget.execute_js("open_file('{}');".format(string_to_base64(f.read())))
else:
self.buffer_widget.eval_js("edit_root_node();")
self.buffer_widget.eval_js("init_root_node();")
self.change_title(self.get_root_node_topic())

@ -20,13 +20,12 @@
editable:true
}
_jm = jsMind.show(options);
function select_root_node() {
_jm.select_node("root");
}
function edit_root_node() {
function init_root_node() {
_jm = jsMind.show(options);
select_root_node();
var selected_node = _jm.get_selected_node(); // as parent of new node
@ -172,6 +171,8 @@
}
function open_file(file_base64_content) {
_jm = jsMind.show(options);
var file_data = decodeURIComponent(escape(window.atob(file_base64_content)));
var mind = jsMind.util.json.string2json(file_data);

Loading…
Cancel
Save