diff --git a/static/html/list.html b/static/html/list.html index 4cb6cf1..27e52e6 100644 --- a/static/html/list.html +++ b/static/html/list.html @@ -125,9 +125,19 @@ view.init() view.fetch_data() + // 绑定事件 - $('#c_').click(function () { - const mind_name = $('#mind_name').val() + $('#crt_out').click(function () { + layer.open({ + type: 1, + content: $('#layer_open'), //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响 + area: ['400px', '200px'] + }); + }) + + // 调用后台创建脑图 + $('#crt_inner').click(function () { + const mind_name = $('#mind_name_crt').val() if (mind_name) { const snapshot_data = { id: 'root', @@ -170,30 +180,31 @@ topic: 'test node', direction: 'left', children: [ - {id: 'other1', topic: "I'm from local variable"}, - {id: 'other2', topic: 'I can do everything'} + {id: 'other1', topic: "多人协作"}, ] } ] } + // $.post('create', {'mind_name': mind_name, 'snapshot_data': view.json2string(snapshot_data)}, function (resp) { - console.log(resp) + layer.closeAll() view.fetch_data() }) } else { layer.msg('请输入导图名称') } }) + // })