Commit e3d7cccb801daceb1829e564cb194a8675693f8d
1 parent
eefa808f
fix: correct the type for undo-redo plugin
Showing
2 changed files
with
7 additions
and
1 deletions
front-end/h5/src/components/core/support/shape.js
| ... | ... | @@ -94,6 +94,7 @@ export default { |
| 94 | 94 | this.handlePointMoveProp(pos) |
| 95 | 95 | } |
| 96 | 96 | let up = () => { |
| 97 | + this.handlePointMouseUpProp() | |
| 97 | 98 | document.removeEventListener('mousemove', move) |
| 98 | 99 | document.removeEventListener('mouseup', up) |
| 99 | 100 | } |
| ... | ... | @@ -125,6 +126,7 @@ export default { |
| 125 | 126 | } |
| 126 | 127 | |
| 127 | 128 | let up = moveEvent => { |
| 129 | + this.handleElementMouseUpProp() | |
| 128 | 130 | document.removeEventListener('mousemove', move, true) |
| 129 | 131 | document.removeEventListener('mouseup', up, true) |
| 130 | 132 | } | ... | ... |
front-end/h5/src/store/plugins/undo-redo/index.js
| 1 | 1 | |
| 2 | 2 | import { cloneDeep } from 'lodash' |
| 3 | 3 | import undoRedoHistory from './History' |
| 4 | -const unRecordHistoryMutationTypes = ['element/setElementCommonStyle'] | |
| 4 | +/** | |
| 5 | + * #!zh: setElementCommonStyle 因为是在 mousemove 时候触发的,执行过于频繁,没有必要计入history,因此需要过滤。 | |
| 6 | + * 主要记录:拖动完成时候(mouseup)时候的位置、删除元素之前的状态等 | |
| 7 | + */ | |
| 8 | +const unRecordHistoryMutationTypes = ['editor/setElementCommonStyle'] | |
| 5 | 9 | |
| 6 | 10 | const undoRedoPlugin = (store) => { |
| 7 | 11 | // initialize and save the starting stage | ... | ... |