From 6dde7e1183f0f5210b9d6de1e36ea7e15e58348b Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Wed, 10 Oct 2018 14:58:58 +0200 Subject: Improve share select list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files_sharing/css/sharetabview.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'apps/files_sharing') diff --git a/apps/files_sharing/css/sharetabview.scss b/apps/files_sharing/css/sharetabview.scss index 14be9562228..11747e5c062 100644 --- a/apps/files_sharing/css/sharetabview.scss +++ b/apps/files_sharing/css/sharetabview.scss @@ -12,6 +12,7 @@ overflow: hidden; line-height: 32px; vertical-align: middle; + flex-grow: 1; } } -- cgit v1.2.3 From 3e11515b9c4ab9f8cb9c3f48082d6d086801c0e7 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Thu, 18 Oct 2018 12:36:37 +0200 Subject: Merge contacts and add type of result to the UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files_sharing/css/sharetabview.scss | 19 ++++++++++ core/js/sharedialogview.js | 60 +++++++++++++++++++++++++++----- 2 files changed, 71 insertions(+), 8 deletions(-) (limited to 'apps/files_sharing') diff --git a/apps/files_sharing/css/sharetabview.scss b/apps/files_sharing/css/sharetabview.scss index 11747e5c062..c3c55c10ba2 100644 --- a/apps/files_sharing/css/sharetabview.scss +++ b/apps/files_sharing/css/sharetabview.scss @@ -4,6 +4,10 @@ .share-autocomplete-item { display: flex; + + &.merged { + margin-left: 32px; + } .autocomplete-item-text { margin-left: 10px; margin-right: 10px; @@ -13,6 +17,21 @@ line-height: 32px; vertical-align: middle; flex-grow: 1; + .ui-state-highlight { + border: none; + margin: 0; + } + } + &.with-description { + .autocomplete-item-text { + line-height: 100%; + } + } + .autocomplete-item-details { + display: block; + line-height: 130%; + font-size: 90%; + opacity: 0.7; } } diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js index 2c31a96324f..8c9e812adfa 100644 --- a/core/js/sharedialogview.js +++ b/core/js/sharedialogview.js @@ -314,10 +314,29 @@ function dynamicSort(property) { return function (a,b) { - return (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0; + var aProperty = ''; + var bProperty = ''; + if (typeof a[property] !== 'undefined') { + aProperty = a[property]; + } + if (typeof b[property] !== 'undefined') { + bProperty = b[property]; + } + return (aProperty < bProperty) ? -1 : (aProperty > bProperty) ? 1 : 0; } } var grouped = suggestions.sort(dynamicSort('uuid')); + console.log(grouped); + var previousUuid = null; + groupedLength = grouped.length; + for (i = 0; i < groupedLength; i++) { + if (typeof grouped[i].uuid !== 'undefined' && grouped[i].uuid === previousUuid) { + grouped[i].merged = true; + } else { + grouped[i].merged = false; + } + previousUuid = grouped[i].uuid; + } var moreResultsAvailable = ( oc_config['sharing.maxAutocompleteResults'] > 0 @@ -469,15 +488,39 @@ text = t('core', '{sharee} (conversation)', { sharee: text }, undefined, { escape: false }); icon = 'icon-talk'; } + var description = ''; + var getTranslatedType = function(type) { + switch (type) { + case 'HOME': + return t('core', 'Home'); + case 'WORK': + return t('core', 'Home'); + case 'OTHER': + return t('core', 'Other'); + default: + return type; + } + }; + if (typeof item.type !== 'undefined') { + description = getTranslatedType(item.type); + } var insert = $("