rt-sim-training-client/src/jmapNew/shape/TrainWindow/EMouse.js
2019-11-29 12:51:58 +08:00

38 lines
868 B
JavaScript

export default class EMouse {
constructor(device) {
this.device = device;
}
mouseover(e) {
if (this.device.prdType) {
this.device.setVisible(true);
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseover) {
instance.mouseEvent.mouseEnter(e);
}
}
}
mouseout(e) {
if (this.device.prdType) {
this.device.setVisible(false || this.device.model.trainWindowShow);
const instance = this.device.getInstanceByCode(this.device.model.sectionCode);
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
instance.mouseEvent.mouseLeave(e);
}
}
}
mouseEnter(e) {
if (this.device.prdType) {
this.device.setVisible(true);
}
}
mouseLeave(e) {
if (this.device.prdType ) {
this.device.setVisible(false);
}
}
}