Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBUI-555: Backport - implemented tab navigation on nuxeo data-grid #1984

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions elements/nuxeo-data-grid/nuxeo-document-grid-thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ Polymer({
border: 2px solid transparent;
}

.bubbleBox:hover,
.bubbleBox:focus {
.bubbleBox:hover {
z-index: 500;
border: 2px solid var(--nuxeo-link-hover-color);
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.04);
Expand Down Expand Up @@ -108,7 +107,6 @@ Polymer({
}

.bubbleBox .select {
display: none;
position: absolute;
top: 1rem;
left: 1rem;
Expand Down Expand Up @@ -142,7 +140,6 @@ Polymer({
}

.bubbleBox .actions {
display: none;
background-color: var(--nuxeo-box);
position: absolute;
bottom: 0;
Expand All @@ -159,12 +156,6 @@ Polymer({
@apply --nuxeo-action-hover;
}

.bubbleBox:hover .actions,
.bubbleBox:hover .select,
.bubbleBox[selection-mode] .select {
display: block;
}

.bubbleBox:hover .select:hover {
border: 2px solid var(--nuxeo-button-primary);
background-color: var(--nuxeo-button-primary);
Expand All @@ -189,14 +180,39 @@ Polymer({
:host(.droptarget-hover) .bubbleBox {
border: 2px dashed var(--nuxeo-grid-selected);
}

:host(:focus) .bubbleBox {
z-index: 500;
border: 2px solid var(--nuxeo-link-hover-color);
box-shadow: 0 3px 5px rgba(0, 0, 0, 0.04);
}

:host(:focus) .bubbleBox .actions,
:host(:focus) .bubbleBox .select,
.bubbleBox:hover .actions,
.bubbleBox:hover .select,
.bubbleBox[selection-mode] .select {
opacity: 1;
height: auto;
overflow: visible;
transition: opacity 0.2s ease, height 0.2s ease;
}

.bubbleBox .actions,
.bubbleBox .select {
opacity: 0;
height: 0;
overflow: hidden;
transition: opacity 0.2s ease, height 0.2s ease;
}
</style>

<div class="bubbleBox grid-box" selection-mode$="[[selectionMode]]">
<div class="thumbnailContainer" on-tap="handleClick">
<div class="thumbnailContainer" on-tap="handleClick" tabindex="0">
<img src="[[_thumbnail(doc)]]" alt$="[[doc.title]]" />
</div>
<template is="dom-if" if="[[_hasDocument(doc)]]">
<a class="title" href$="[[urlFor(doc)]]" on-tap="handleClick">
<a class="title" href$="[[urlFor(doc)]]" on-tap="handleClick" tabindex="0">
<div class="dataContainer">
<div class="title" id="title">[[doc.title]]</div>
<nuxeo-tag>[[formatDocType(doc.type)]]</nuxeo-tag>
Expand Down
6 changes: 5 additions & 1 deletion elements/search/default/nuxeo-default-search-results.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
>
<template>
<nuxeo-document-grid-thumbnail
tabindex$="{{tabIndex}}"
tabindex$="{{_computeTabIndex(index)}}"
selected$="{{selected}}"
doc="[[item]]"
index="[[index]]"
Expand Down Expand Up @@ -246,6 +246,10 @@
_contentStoredInColdStorage(doc) {
return this.hasFacet(doc, 'ColdStorage') && doc.properties && doc.properties['coldstorage:coldContent'];
},

_computeTabIndex(index) {
return (index + 1).toString();
},
});
</script>
</dom-module>
Loading