From f9f0d0f8c47021d5a8124058074f4525131131a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 22 Mar 2018 18:06:30 +0100 Subject: [PATCH 1/2] Fix reference error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no "view" nor "configModel" in a Share of the gallery; configuration parameters are got using "oc_appconfig". Signed-off-by: Daniel Calviño Sánchez --- js/vendor/nextcloud/share.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/vendor/nextcloud/share.js b/js/vendor/nextcloud/share.js index 6510c9031..ace2912e4 100644 --- a/js/vendor/nextcloud/share.js +++ b/js/vendor/nextcloud/share.js @@ -403,7 +403,7 @@ } else { var title = t('gallery', 'No users or groups found for {search}', {search: $('#shareWith').val()}); - if (!view.configModel.get('allowGroupSharing')) { + if (!oc_appconfig.core.allowGroupSharing) { title = t('gallery', 'No users found for {search}', {search: $('#shareWith').val()}); } $('#shareWith').addClass('error') From c0cd2af21ee1c7d9d4219b41553c18dcccb04319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 22 Mar 2018 18:35:11 +0100 Subject: [PATCH 2/2] Hide tooltip when the input field is cleared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "No results found" tooltip is now removed when the input field is cleared. This unifies its behaviour with the one used in the server, but it does not address its problems (for example, if a search is started and while it is being performed the input field is cleared the tooltip would be still shown once the search response is received, even if the input field is now empty). Signed-off-by: Daniel Calviño Sánchez --- js/vendor/nextcloud/share.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/vendor/nextcloud/share.js b/js/vendor/nextcloud/share.js index ace2912e4..f0e94fd99 100644 --- a/js/vendor/nextcloud/share.js +++ b/js/vendor/nextcloud/share.js @@ -514,6 +514,12 @@ .appendTo(ul); }; + $('#shareWith').on('input', function () { + if ($(this).val().length < 2) { + $(this).removeClass('error').tooltip('hide'); + } + }); + if (link && linksAllowed && $('#email').length != 0) { $('#email').autocomplete({ minLength: 1,