Skip to content

Commit

Permalink
add confirm for delete, not finish yet
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Aug 3, 2016
1 parent 35f8ec8 commit 8a19544
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions res/index.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,17 @@
<a class="btn btn-default btn-xs visible-xs" v-if="shouldHaveQrcode(f.name)" href="{{genInstallURL(f.name)}}">
Install
</a>
<a class="btn btn-default btn-xs" v-if="auth.delete" v-on:click="deletePath(f, $event)" href="javascript:void(0)">
<span style="color:#CC3300" class="glyphicon glyphicon-remove"></span>
<a class="btn btn-default btn-xs" v-if="auth.delete" v-on:click="deletePathConfirm(f, $event)" href="javascript:void(0)">
<span style="color:#CC3300" class="glyphicon glyphicon-trash"></span>
</a>
<template v-if="f.showConfirm">
<button class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-ok"></span>
</button>
<button class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-remove"></span>
</button>
</template>
</template>
</td>
</tr>
Expand Down
6 changes: 5 additions & 1 deletion res/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,13 @@ var vm = new Vue({
loadDirectory(reqPath);
e.preventDefault()
},
deletePath: function(f, e) {
deletePathConfirm: function(f, e) {
// confirm
e.preventDefault();
f.showConfirm = true;
f.name = "JJ"
console.log(f)
return;
$.ajax({
url: pathJoin([location.pathname, f.name]),
method: 'DELETE',
Expand Down

0 comments on commit 8a19544

Please sign in to comment.