From 83651aa687f3ee051211d71ffc96ee7a97484444 Mon Sep 17 00:00:00 2001 From: wrmswindmill Date: Wed, 15 Aug 2018 00:48:23 +0800 Subject: [PATCH] =?UTF-8?q?FIXBUG:=20=E4=BF=AE=E5=A4=8D=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=A1=B5=E5=AF=B9=E5=BA=94url=E7=9A=84bug=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9url=E5=9C=B0=E5=9D=80=E6=A0=8F=E7=9A=84url?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=94=BE=E5=9C=A8open=5Ftab()=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/source.js | 30 ++++++++++++++++++------------ templates/projects/source.html | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/static/js/source.js b/static/js/source.js index 713e1b4..ec95108 100644 --- a/static/js/source.js +++ b/static/js/source.js @@ -429,30 +429,29 @@ function show_navigation() { success: function (data) { if (data.status === 'success') { - var content = ""; + var content = ""; + str += "" content += str; } + content += "" // document.getElementById("annotation").style.display="block"; navigation_map.set(project_path + file_path, content) $("#structure-context").html(content) @@ -622,6 +621,15 @@ function path_predeal(path){ // 打开一个已经存在的标签页 // 注意这个还得将对应的路径更改了 function open_tab(path) { + + var ip=window.location.host; //端口号 + // console.log(window.location.pathname); 端口号后面的路径 + var projectName= $("#projectName").text(); + var newhtefpath = "/projects/"+projectName+path; + var stateObject = {}; + //修改地址栏中的地址 + history.pushState(stateObject, ip, newhtefpath); + path_input=path path = path_predeal(path) @@ -663,16 +671,14 @@ function open_tab(path) { // 如果标签页已经存在,则打开对应的标签页 // 并调用open_tab function add_tab(project_id,path,filename) { - + var tree_node = $("#jstree").jstree("get_selected"); - var path_before = path //需要将path处理一下,因为css样式中/以及.是不行的 tmp_index = path.indexOf("#"); if(tmp_index != -1){ path = path.substring(0,tmp_index) } - var path_input = path; path = path_predeal(path) diff --git a/templates/projects/source.html b/templates/projects/source.html index d9b3094..c74b3ae 100644 --- a/templates/projects/source.html +++ b/templates/projects/source.html @@ -30,7 +30,6 @@ {{ project.name }}-{{ project.desc }} -
@@ -139,6 +138,7 @@
+ {{ project.name }} \ No newline at end of file