Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-03-19 15:11:14 +0400
committerJoas Schilling <nickvergessen@gmx.de>2014-03-19 15:11:14 +0400
commit7ab2632085440d3e792b4ccca3c527d26f10cad2 (patch)
tree72bdc54187676bfc58506bbff7c5d2bd7f72a184 /core
parent80393d9c0ff44c0614960cc6b7b7d8cc5bd17743 (diff)
Use tipsy to display error when selecting a date in the past
Diffstat (limited to 'core')
-rw-r--r--core/js/share.js12
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');
}
});
});