完善撤回逻辑
This commit is contained in:
@@ -28,8 +28,7 @@ export class DOBlock {
|
||||
}
|
||||
public set_show(show: number): void {
|
||||
this.data.show = show
|
||||
if (show == this.get_correct())
|
||||
this.checked = true
|
||||
this.checked = show == this.get_correct()
|
||||
StorageManager.getInstance().onChanged()
|
||||
}
|
||||
|
||||
|
||||
@@ -129,8 +129,14 @@ export class DOStage {
|
||||
public get_undos(): Array<DataUndo> {
|
||||
return this.data.undos
|
||||
}
|
||||
public add_undo(type: number, index: number, value: number): void {
|
||||
var dataUndo: DataUndo = {type: type, index: index, value: value}
|
||||
public add_undo(index: number, show: number=0, notes: Array<number>=new Array()): void {
|
||||
var _notes: Array<number>
|
||||
if (notes) {
|
||||
_notes = new Array()
|
||||
for (var i=0; i<notes.length; i++)
|
||||
_notes.push(notes[i])
|
||||
}
|
||||
var dataUndo: DataUndo = {index: index, show: show, notes: _notes}
|
||||
console.log("add_undo >>>>>>>>>>>>>>>>>>>>>>>>>>>>", JSON.stringify(dataUndo))
|
||||
this.data.undos.push(dataUndo)
|
||||
StorageManager.getInstance().onChanged()
|
||||
|
||||
Reference in New Issue
Block a user