Created
April 15, 2021 14:58
-
-
Save leastbad/3fe3b467da0667569a490b445a30a31d to your computer and use it in GitHub Desktop.
CableReady custom operations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CableReady from 'cable_ready' | |
import { dispatch } from 'cable_ready/javascript/utils' | |
CableReady.DOMOperations.removeSubelement = operation => { | |
const { element, subElement } = operation | |
dispatch(element, 'cable-ready:before-remove-subelement', operation) | |
element.contentDocument.querySelector(subElement).remove() | |
dispatch(element, 'cable-ready:after-remove-subelement', operation) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment