Skip to content

Commit

Permalink
fix: correct the type for undo-redo plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ly525 committed Aug 30, 2019
1 parent eefa808 commit e3d7ccc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions front-end/h5/src/components/core/support/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default {
this.handlePointMoveProp(pos)
}
let up = () => {
this.handlePointMouseUpProp()
document.removeEventListener('mousemove', move)
document.removeEventListener('mouseup', up)
}
Expand Down Expand Up @@ -125,6 +126,7 @@ export default {
}

let up = moveEvent => {
this.handleElementMouseUpProp()
document.removeEventListener('mousemove', move, true)
document.removeEventListener('mouseup', up, true)
}
Expand Down
6 changes: 5 additions & 1 deletion front-end/h5/src/store/plugins/undo-redo/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@

import { cloneDeep } from 'lodash'
import undoRedoHistory from './History'
const unRecordHistoryMutationTypes = ['element/setElementCommonStyle']
/**
* #!zh: setElementCommonStyle 因为是在 mousemove 时候触发的,执行过于频繁,没有必要计入history,因此需要过滤。
* 主要记录:拖动完成时候(mouseup)时候的位置、删除元素之前的状态等
*/
const unRecordHistoryMutationTypes = ['editor/setElementCommonStyle']

const undoRedoPlugin = (store) => {
// initialize and save the starting stage
Expand Down

0 comments on commit e3d7ccc

Please sign in to comment.