mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
TSK-1381: Show preview and Table mouse hover selection (#3098)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
1c0d04132a
commit
cc9b6c1e3b
@ -135,12 +135,13 @@ function ShowActions (doc: Doc | Doc[] | undefined, evt: Event): void {
|
||||
showPopup(view.component.ActionsPopup, { viewContext: $contextStore[$contextStore.length - 1] }, 'top')
|
||||
}
|
||||
|
||||
function ShowPreview (doc: Doc | undefined, evt: Event): void {
|
||||
function ShowPreview (doc: Doc | Doc[] | undefined, evt: Event): void {
|
||||
previewDocument.update((old) => {
|
||||
if (old?._id === doc?._id) {
|
||||
const d = Array.isArray(doc) ? doc[0] : doc
|
||||
if (old?._id === d?._id) {
|
||||
return undefined
|
||||
}
|
||||
return doc
|
||||
return d
|
||||
})
|
||||
evt.preventDefault()
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import core, { Doc, Ref, TxRemoveDoc } from '@hcengineering/core'
|
||||
import core, { Doc, Hierarchy, Ref, TxRemoveDoc } from '@hcengineering/core'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
import { addTxListener, getClient } from '@hcengineering/presentation'
|
||||
import { AnyComponent, Component } from '@hcengineering/ui'
|
||||
@ -217,7 +217,7 @@
|
||||
|
||||
let presenter: AnyComponent | undefined
|
||||
async function updatePreviewPresenter (doc?: Doc): Promise<void> {
|
||||
presenter = doc !== undefined ? await getObjectPreview(client, doc._class) : undefined
|
||||
presenter = doc !== undefined ? await getObjectPreview(client, Hierarchy.mixinOrClass(doc)) : undefined
|
||||
}
|
||||
|
||||
$: updatePreviewPresenter($previewDocument)
|
||||
|
@ -278,7 +278,7 @@
|
||||
class:checking={checkedSet.has(object._id)}
|
||||
class:fixed={row === selection}
|
||||
class:selected={row === selection}
|
||||
on:mouseenter={mouseAttractor(() => onRow(object))}
|
||||
on:mouseover={mouseAttractor(() => onRow(object))}
|
||||
on:focus={() => {}}
|
||||
bind:this={refs[row]}
|
||||
on:contextmenu|preventDefault={(ev) => {
|
||||
|
Loading…
Reference in New Issue
Block a user