diff options
author | Sam Tuke <samtuke@owncloud.com> | 2012-06-21 14:53:58 +0100 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2012-06-21 14:54:24 +0100 |
commit | 7c3f6f61db5b93c3393ab4b3b99c3e6906ed27be (patch) | |
tree | 107c613d2edcc314036d08cae680bf1eccb53650 /apps/files_versions | |
parent | f5740a6f925ddcd78a563ab38db88f05d6a77317 (diff) | |
download | nextcloud-server-7c3f6f61db5b93c3393ab4b3b99c3e6906ed27be.tar.gz nextcloud-server-7c3f6f61db5b93c3393ab4b3b99c3e6906ed27be.zip |
Fixed missing jQuery event object - expire interface now works with Firefox
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/js/settings-personal.js | 78 |
1 files changed, 33 insertions, 45 deletions
diff --git a/apps/files_versions/js/settings-personal.js b/apps/files_versions/js/settings-personal.js index d9456f3f2af..6ea8c1a950f 100644 --- a/apps/files_versions/js/settings-personal.js +++ b/apps/files_versions/js/settings-personal.js @@ -1,51 +1,39 @@ -// $(document).ready(function(){ -// $('#versions').change( function(){ -// OC.msg.startSaving('#calendar .msg') -// // Serialize the data -// var post = $( '#timezone' ).serialize(); -// $.post( OC.filePath('calendar', 'ajax/settings', 'settimezone.php'), post, function(data){ -// //OC.msg.finishedSaving('#calendar .msg', data); -// }); -// return false; -// }); -// }); +// TODO: allow the button to be clicked only once -$(document).ready(function(){ +$( document ).ready(function(){ // - $('#expireAllBtn').click(function(){ + $( '#expireAllBtn' ).click( - // Prevent page from reloading - event.preventDefault(); + function( event ) { - // Show loading gif - $('.expireAllLoading').show(); - - $.getJSON( - OC.filePath('files_versions','ajax','expireAll.php'), - function(result){ - if (result.status == 'success') { - $('.expireAllLoading').hide(); - $('#expireAllBtn').html('Expiration successful'); - } else { - - // Cancel loading - $('#expireAllBtn').html('Expiration failed'); - - // Show Dialog - OC.dialogs.alert( - 'Something went wrong, your files may not have been expired', - 'An error has occurred', - function(){ - $('#expireAllBtn').html(t('files_versions', 'Expire all versions')+'<img style="display: none;" class="loading" src="'+OC.filePath('core','img','loading.gif')+'" />'); - } - - ); - - } - } + // Prevent page from reloading + event.preventDefault(); - ); - - }); - + // Show loading gif + $('.expireAllLoading').show(); + + $.getJSON( + OC.filePath('files_versions','ajax','expireAll.php'), + function(result){ + if (result.status == 'success') { + $('.expireAllLoading').hide(); + $('#expireAllBtn').html('Expiration successful'); + } else { + + // Cancel loading + $('#expireAllBtn').html('Expiration failed'); + + // Show Dialog + OC.dialogs.alert( + 'Something went wrong, your files may not have been expired', + 'An error has occurred', + function(){ + $('#expireAllBtn').html(t('files_versions', 'Expire all versions')+'<img style="display: none;" class="loading" src="'+OC.filePath('core','img','loading.gif')+'" />'); + } + ); + } + } + ); + } + ); });
\ No newline at end of file |