Commit 547223aa authored by Ronny's avatar Ronny

mindmanager新建节点默认不带text,直接传空字符串

parent 3981e134
......@@ -32,7 +32,8 @@ function exportNode( node ) {
var DEFAULT_TEXT = {
'root': 'maintopic',
'main': 'topic'
'main': 'topic',
'sub': 'topic'
};
function importNode( node, json, km ) {
......@@ -40,14 +41,14 @@ function importNode( node, json, km ) {
for ( var field in data ) {
node.setData( field, data[ field ] );
}
node.setText( data.text || km.getLang( DEFAULT_TEXT[ data.type ] ) );
node.setText( data.text || km.getLang( DEFAULT_TEXT[ node.getType() ] ) );
var childrenTreeData = json.children;
if ( !childrenTreeData ) return;
for ( var i = 0; i < childrenTreeData.length; i++ ) {
var childNode = new MinderNode();
importNode( childNode, childrenTreeData[ i ], km );
node.appendChild( childNode );
importNode( childNode, childrenTreeData[ i ], km );
}
return node;
}
......
......@@ -25,7 +25,7 @@ KityMinder.registerProtocal( 'mindmanager', function () {
function processTopic(topic, obj){
//处理文本
obj.data = { text : topic.Text && topic.Text.PlainText || '_' }; // 节点默认的文本,没有Text属性
obj.data = { text : topic.Text && topic.Text.PlainText || '' }; // 节点默认的文本,没有Text属性
// 处理标签
if(topic.Task){
......
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