There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

restore-clone

Note: This command has an issue that will be resolved in an upcoming release. Its functionality is limited. If it works for you now, great! Otherwise don't use it yet.

Syntax

restore-clone: (selector) [every (time)] [after (time)][, (selector)...];

This command places the previously cloned node into and at the location of the target selector.

selector: This is the target selector that was used for a previous "clone" command.

The target selector that the restore-clone command is inside does not have to match the clone selector reference, ie. you can restore clones multiple times into different locations. See the example below for an example of that.

#myDiv:click {
    #myChangingSection {
        clone: true;
    }
}

#mySecondDiv:click {
    #differentArea {
        restore-clone: #myChangingSection;
    }    
}

To remove a clone from memory, see the "remove-clone" command.

It could be used to restore part of the DOM tree to the condition it was in, prior to changes made after a clone was made.

Note: Care must be taken when cloning and restoring clones, as it can be quite an action to perform on the DOM structurally, especially if you are cloning a large part of the DOM, so you need to make sure that your browsers can sufficiently handle the action predictably for these commands to be of any use.

Also, if all you want to do is do a form reset, you should use the "form-reset" command rather than doing a deep-copy clone and restoration of the form.

Keep an eye out for related events that might be happening at the same time, so that things don't go weird when you start removing and restoring clones.

restore-clone