mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-23 08:48:01 +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')
|
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) => {
|
previewDocument.update((old) => {
|
||||||
if (old?._id === doc?._id) {
|
const d = Array.isArray(doc) ? doc[0] : doc
|
||||||
|
if (old?._id === d?._id) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
return doc
|
return d
|
||||||
})
|
})
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<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 { getResource } from '@hcengineering/platform'
|
||||||
import { addTxListener, getClient } from '@hcengineering/presentation'
|
import { addTxListener, getClient } from '@hcengineering/presentation'
|
||||||
import { AnyComponent, Component } from '@hcengineering/ui'
|
import { AnyComponent, Component } from '@hcengineering/ui'
|
||||||
@ -217,7 +217,7 @@
|
|||||||
|
|
||||||
let presenter: AnyComponent | undefined
|
let presenter: AnyComponent | undefined
|
||||||
async function updatePreviewPresenter (doc?: Doc): Promise<void> {
|
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)
|
$: updatePreviewPresenter($previewDocument)
|
||||||
|
@ -278,7 +278,7 @@
|
|||||||
class:checking={checkedSet.has(object._id)}
|
class:checking={checkedSet.has(object._id)}
|
||||||
class:fixed={row === selection}
|
class:fixed={row === selection}
|
||||||
class:selected={row === selection}
|
class:selected={row === selection}
|
||||||
on:mouseenter={mouseAttractor(() => onRow(object))}
|
on:mouseover={mouseAttractor(() => onRow(object))}
|
||||||
on:focus={() => {}}
|
on:focus={() => {}}
|
||||||
bind:this={refs[row]}
|
bind:this={refs[row]}
|
||||||
on:contextmenu|preventDefault={(ev) => {
|
on:contextmenu|preventDefault={(ev) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user