diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-03-19 12:11:14 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-03-19 12:11:14 +0100 |
commit | 7ab2632085440d3e792b4ccca3c527d26f10cad2 (patch) | |
tree | 72bdc54187676bfc58506bbff7c5d2bd7f72a184 /core | |
parent | 80393d9c0ff44c0614960cc6b7b7d8cc5bd17743 (diff) | |
download | nextcloud-server-7ab2632085440d3e792b4ccca3c527d26f10cad2.tar.gz nextcloud-server-7ab2632085440d3e792b4ccca3c527d26f10cad2.zip |
Use tipsy to display error when selecting a date in the past
Diffstat (limited to 'core')
-rw-r--r-- | core/js/share.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/js/share.js b/core/js/share.js index 0b65e153093..02d16cbd898 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -718,13 +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') { + var expirationDateField = $('#dropdown #expirationDate'); if (!result.data.message) { - OC.dialogs.alert(t('core', 'Error setting expiration date'), t('core', 'Error')); + expirationDateField.attr('original-title', t('core', 'Error setting expiration date')); } else { - OC.dialogs.alert(result.data.message, t('core', 'Error')); + expirationDateField.attr('original-title', result.data.message); } + expirationDateField.tipsy({gravity: 'n', fade: true}); + expirationDateField.tipsy('show'); + expirationDateField.addClass('error'); } }); }); |