Improve share select list

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-10-10 14:58:58 +02:00
parent c9e6a99637
commit 6dde7e1183
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
3 changed files with 13 additions and 1 deletions

View File

@ -12,6 +12,7 @@
overflow: hidden; overflow: hidden;
line-height: 32px; line-height: 32px;
vertical-align: middle; vertical-align: middle;
flex-grow: 1;
} }
} }

View File

@ -171,9 +171,12 @@
&.ui-menu { &.ui-menu {
padding: 0; padding: 0;
.ui-menu-item a { .ui-menu-item a {
color: var(--color-text-lighter);
padding: 4px 4px 4px 14px;
&.ui-state-focus, &.ui-state-active { &.ui-state-focus, &.ui-state-active {
font-weight: inherit;
box-shadow: inset 4px 0 var(--color-primary); box-shadow: inset 4px 0 var(--color-primary);
color: var(--color-text);
} }
} }
} }

View File

@ -442,19 +442,26 @@
autocompleteRenderItem: function(ul, item) { autocompleteRenderItem: function(ul, item) {
var icon = 'icon-user';
var text = item.label; var text = item.label;
if (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) { if (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) {
text = t('core', '{sharee} (group)', { sharee: text }, undefined, { escape: false }); text = t('core', '{sharee} (group)', { sharee: text }, undefined, { escape: false });
icon = 'icon-contacts-dark';
} else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) { } else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) {
text = t('core', '{sharee} (remote)', {sharee: text}, undefined, {escape: false}); text = t('core', '{sharee} (remote)', {sharee: text}, undefined, {escape: false});
icon = 'icon-shared';
} else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) { } else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) {
text = t('core', '{sharee} (remote group)', { sharee: text }, undefined, { escape: false }); text = t('core', '{sharee} (remote group)', { sharee: text }, undefined, { escape: false });
icon = 'icon-shared';
} else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) { } else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) {
text = t('core', '{sharee} (email)', { sharee: text }, undefined, { escape: false }); text = t('core', '{sharee} (email)', { sharee: text }, undefined, { escape: false });
icon = 'icon-mail';
} else if (item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) { } else if (item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) {
text = t('core', '{sharee} ({type}, {owner})', {sharee: text, type: item.value.circleInfo, owner: item.value.circleOwner}, undefined, {escape: false}); text = t('core', '{sharee} ({type}, {owner})', {sharee: text, type: item.value.circleInfo, owner: item.value.circleOwner}, undefined, {escape: false});
icon = 'icon-circle';
} else if (item.value.shareType === OC.Share.SHARE_TYPE_ROOM) { } else if (item.value.shareType === OC.Share.SHARE_TYPE_ROOM) {
text = t('core', '{sharee} (conversation)', { sharee: text }, undefined, { escape: false }); text = t('core', '{sharee} (conversation)', { sharee: text }, undefined, { escape: false });
icon = 'icon-talk';
} }
var insert = $("<div class='share-autocomplete-item'/>"); var insert = $("<div class='share-autocomplete-item'/>");
var avatar = $("<div class='avatardiv'></div>").appendTo(insert); var avatar = $("<div class='avatardiv'></div>").appendTo(insert);
@ -468,6 +475,7 @@
.text(text) .text(text)
.appendTo(insert); .appendTo(insert);
insert.attr('title', item.value.shareWith); insert.attr('title', item.value.shareWith);
insert.append('<span class="icon '+icon+'"></span>');
insert = $("<a>") insert = $("<a>")
.append(insert); .append(insert);
return $("<li>") return $("<li>")