diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-12 16:09:37 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-12 16:09:37 +0100 |
commit | 761e9cf3a48ed0b2cf92ccb81f2e7483cc4542da (patch) | |
tree | 10480f6875710eb61d859704606779a854c8c2a8 /core/js | |
parent | ad9dea8edf64c231c5ef3b201608431239f90beb (diff) | |
parent | b786523bb7ee25ff784e89692cb77e1f903a90bc (diff) | |
download | nextcloud-server-761e9cf3a48ed0b2cf92ccb81f2e7483cc4542da.tar.gz nextcloud-server-761e9cf3a48ed0b2cf92ccb81f2e7483cc4542da.zip |
Merge pull request #21837 from owncloud/recipients-error-message
First try for shareWithField error message
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/sharedialogview.js | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 4cebf7962e8..ea7e198cb46 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -67,6 +67,10 @@ /** @type {object} **/ shareeListView: undefined, + events: { + 'input .shareWithField': 'onShareWithFieldChanged' + }, + initialize: function(options) { var view = this; @@ -109,7 +113,18 @@ : options[name]; } - _.bindAll(this, 'autocompleteHandler', '_onSelectRecipient'); + _.bindAll(this, + 'autocompleteHandler', + '_onSelectRecipient', + 'onShareWithFieldChanged' + ); + }, + + onShareWithFieldChanged: function() { + var $el = this.$el.find('.shareWithField'); + if ($el.val().length < 2) { + $el.removeClass('error').tooltip('hide'); + } }, autocompleteHandler: function (search, response) { @@ -196,9 +211,20 @@ var suggestions = users.concat(groups).concat(remotes); if (suggestions.length > 0) { - $('.shareWithField').autocomplete("option", "autoFocus", true); + $('.shareWithField').removeClass('error') + .tooltip('hide') + .autocomplete("option", "autoFocus", true); response(suggestions); } else { + $('.shareWithField').addClass('error') + .attr('data-original-title', t('core', 'No users or groups found for {search}', {search: $('.shareWithField').val()})) + .tooltip('hide') + .tooltip({ + placement: 'bottom', + trigger: 'manual', + }) + .tooltip('fixTitle') + .tooltip('show'); response(); } } else { |