summaryrefslogtreecommitdiffstats
path: root/files/js/fileactions.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-29 00:26:23 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-29 00:26:23 +0200
commitc73dd86713de9e249bee432f7728dfd06859fac3 (patch)
tree42d77387df24d2965422484ac802b022a55eb14d /files/js/fileactions.js
parent433ad8c3ce80dde20e4fc0ea4cc3edaae2c0654f (diff)
downloadnextcloud-server-c73dd86713de9e249bee432f7728dfd06859fac3.tar.gz
nextcloud-server-c73dd86713de9e249bee432f7728dfd06859fac3.zip
confirmation dialogs for deletions
Diffstat (limited to 'files/js/fileactions.js')
-rw-r--r--files/js/fileactions.js28
1 files changed, 21 insertions, 7 deletions
diff --git a/files/js/fileactions.js b/files/js/fileactions.js
index 1eb885f06de..e1f25885fec 100644
--- a/files/js/fileactions.js
+++ b/files/js/fileactions.js
@@ -114,13 +114,27 @@ FileActions.register('all','Download',OC.imagePath('core','actions/download'),fu
});
FileActions.register('all','Delete',OC.imagePath('core','actions/delete'),function(filename){
- $.ajax({
- url: 'ajax/delete.php',
- data: "dir="+encodeURIComponent($('#dir').val())+"&file="+encodeURIComponent(filename),
- complete: function(data){
- boolOperationFinished(data, function(){
- FileList.remove(filename);
- });
+ $( "#delete-confirm" ).dialog({
+ resizable: false,
+ height:200,
+ title:"Delete "+filename,
+ modal: true,
+ buttons: {
+ "Delete": function() {
+ $( this ).dialog( "close" );
+ $.ajax({
+ url: 'ajax/delete.php',
+ data: "dir="+encodeURIComponent($('#dir').val())+"&file="+encodeURIComponent(filename),
+ complete: function(data){
+ boolOperationFinished(data, function(){
+ FileList.remove(filename);
+ });
+ }
+ });
+ },
+ Cancel: function() {
+ $( this ).dialog( "close" );
+ }
}
});
});