fix: 🐛 auto fix node's css className on mouseenter (#566)
auto update cursor style by movable status fix #558
This commit is contained in:
@ -29,13 +29,25 @@ export class NodeView<
|
||||
}
|
||||
|
||||
protected getContainerClassName() {
|
||||
const classList = [super.getContainerClassName(), this.prefixClassName('node')]
|
||||
const classList = [
|
||||
super.getContainerClassName(),
|
||||
this.prefixClassName('node'),
|
||||
]
|
||||
if (!this.can('nodeMovable')) {
|
||||
classList.push(this.prefixClassName('node-immovable'))
|
||||
}
|
||||
return classList.join(' ')
|
||||
}
|
||||
|
||||
protected updateClassName() {
|
||||
const className = this.prefixClassName('node-immovable')
|
||||
if (this.can('nodeMovable')) {
|
||||
this.removeClass(className)
|
||||
} else {
|
||||
this.addClass(className)
|
||||
}
|
||||
}
|
||||
|
||||
isNodeView(): this is NodeView {
|
||||
return true
|
||||
}
|
||||
@ -666,6 +678,7 @@ export class NodeView<
|
||||
}
|
||||
|
||||
onMouseEnter(e: JQuery.MouseEnterEvent) {
|
||||
this.updateClassName()
|
||||
super.onMouseEnter(e)
|
||||
this.notify('node:mouseenter', this.getEventArgs(e))
|
||||
}
|
||||
|
Reference in New Issue
Block a user