|
|
@@ -155,17 +155,17 @@ |
|
|
|
</tr> |
|
|
|
<tr style="display: none;" class="context-menu-one"> |
|
|
|
<td colspan="12"> |
|
|
|
<form class="ui column form" method="POST"> |
|
|
|
<div class="ui column form" method="POST"> |
|
|
|
<div class="two fields" style="margin: 0;"> |
|
|
|
<div class="five wide field"> |
|
|
|
<input class="ui input" name="new_filename" type="text" value="test"> |
|
|
|
<input class="ui input" name="new_filename" type="text" value=""> |
|
|
|
</div> |
|
|
|
<div class="five wide field"> |
|
|
|
<button class="ui blue button popup-save" type="submit">保存</button> |
|
|
|
<button class="ui blue button popup-save" type="button" data-postBasePath="{{$.RepoLink}}/_rename/{{EscapePound $.BranchName}}{{if $.TreePath}}/{{EscapePound $.TreePath}}{{end}}/{{$entry.Name}}" data-commit="{{$.LatestCommit.ID}}" data-treepath="{{if $.TreePath}}/{{EscapePound $.TreePath}}{{end}}/">保存</button> |
|
|
|
<button class="ui basic button popup-close" type="button">取消</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
{{end}} |
|
|
@@ -366,6 +366,7 @@ |
|
|
|
// if (a.target.nodeName === 'LI') { |
|
|
|
// a.target.remove() |
|
|
|
// } |
|
|
|
console.log(e,a) |
|
|
|
document.querySelectorAll(".context-menu-one").forEach((ele)=>{ |
|
|
|
if(ele.style.display==='table-row'){ |
|
|
|
|
|
|
@@ -380,6 +381,29 @@ |
|
|
|
a.currentTarget.parentNode.nextElementSibling.getElementsByTagName("input")[0].setAttribute("value", a.currentTarget.getElementsByTagName("a")[0].getAttribute('title')) |
|
|
|
|
|
|
|
} |
|
|
|
console.log(a.currentTarget.parentNode.nextElementSibling) |
|
|
|
let btn = a.currentTarget.parentNode.nextElementSibling.getElementsByTagName("button")[0] |
|
|
|
console.log(btn) |
|
|
|
btn.addEventListener('click',function(e) { |
|
|
|
console.log('ckilc',e.target.parentNode.previousElementSibling.getElementsByTagName("input")[0]) |
|
|
|
|
|
|
|
let postUrl = btn.getAttribute('data-postbasepath') |
|
|
|
let last_commit = btn.getAttribute('data-commit') |
|
|
|
let tree_path = btn.getAttribute('data-treepath') + e.target.parentNode.previousElementSibling.getElementsByTagName("input")[0].value |
|
|
|
console.log(postUrl,last_commit) |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
url:postUrl, |
|
|
|
type: "POST", |
|
|
|
contentType: "application/x-www-form-urlencoded", |
|
|
|
data:{last_commit:last_commit,tree_path:tree_path}, |
|
|
|
success:function(res){ |
|
|
|
console.log(res) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
// beforeDisabled: (e) => { |
|
|
|
// console.log(e,e.target) |
|
|
|