diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-07-29 00:26:23 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-07-29 00:26:23 +0200 |
commit | c73dd86713de9e249bee432f7728dfd06859fac3 (patch) | |
tree | 42d77387df24d2965422484ac802b022a55eb14d /files/js/fileactions.js | |
parent | 433ad8c3ce80dde20e4fc0ea4cc3edaae2c0654f (diff) | |
download | nextcloud-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.js | 28 |
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" ); + } } }); }); |