diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-19 15:53:08 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-19 15:53:08 +0100 |
commit | 6252c248c23661beef6484cf1ffa24db406e28ae (patch) | |
tree | 724a05b26de55b6325448f49e05bb4f58cd0fc8f /core/js/share.js | |
parent | 4f95adfb7680deafa8dba60ecd138f049afdc673 (diff) | |
parent | 7ab2632085440d3e792b4ccca3c527d26f10cad2 (diff) | |
download | nextcloud-server-6252c248c23661beef6484cf1ffa24db406e28ae.tar.gz nextcloud-server-6252c248c23661beef6484cf1ffa24db406e28ae.zip |
Merge pull request #7557 from owncloud/issue/7297
Do not allow setting an expiration date in the past
Diffstat (limited to 'core/js/share.js')
-rw-r--r-- | core/js/share.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/js/share.js b/core/js/share.js index 129e50b22d5..9ee50ff6963 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -718,9 +718,21 @@ $(document).ready(function() { $(document).on('change', '#dropdown #expirationDate', function() { var itemType = $('#dropdown').data('item-type'); var itemSource = $('#dropdown').data('item-source'); + + $(this).tipsy('hide'); + $(this).removeClass('error'); + $.post(OC.filePath('core', 'ajax', 'share.php'), { action: 'setExpirationDate', itemType: itemType, itemSource: itemSource, date: $(this).val() }, function(result) { if (!result || result.status !== 'success') { - OC.dialogs.alert(t('core', 'Error setting expiration date'), t('core', 'Error')); + var expirationDateField = $('#dropdown #expirationDate'); + if (!result.data.message) { + expirationDateField.attr('original-title', t('core', 'Error setting expiration date')); + } else { + expirationDateField.attr('original-title', result.data.message); + } + expirationDateField.tipsy({gravity: 'n', fade: true}); + expirationDateField.tipsy('show'); + expirationDateField.addClass('error'); } }); }); |