import { ActionSerialized } from './ActionSerialized' ; import { Action } from "./Action" ; export class ActionMagnetDelete extends Action { readonly magnetid : string ; readonly magnet : HTMLElement ; get xMax ( ) : number { return 0 ; } serializeData ( ) { return { type : "magnetdelete" , pause : this . pause , userid : this . userid , magnetid : this . magnetid } ; } constructor ( userid , magnetid ) { super ( userid ) ; this . magnetid = magnetid ; this . isDirectlyUndoable = true ; } createOverviewImage ( ) { return "url(img/icons/E262.svg)" ; } description async undo ( ) { const element = document . getElementById ( this . magnetid ) ; if ( element ) element . style . visibility = "visible" ; } /**
     * perform the deletion of the magnet
     */ async redo ( ) { const element = document . getElementById ( this . magnetid ) ; if ( element ) element . style . visibility = "hidden" ; } }