Skip to content

Commit c754968

Browse files
author
Graham Butler
committed
add ability to disable child monitor
1 parent c51906c commit c754968

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@author.io/element-base",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "Base class for all author-* custom elements (web components).",
55
"main": "dist/author-base.min.js",
66
"scripts": {

src/element.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,20 @@ const AuthorBaseElement = superClass => class extends superClass {
907907
}
908908
},
909909

910+
/**
911+
* @method disableChildMonitor
912+
* Disable monitoring of child elements.
913+
* Disconnects MutationObserver and sets this.childMonitor to null.
914+
*/
915+
disableChildMonitor: {
916+
value: () => {
917+
if (this.childMonitor) {
918+
this.childMonitor.disconnect()
919+
this.childMonitor = null
920+
}
921+
}
922+
},
923+
910924
/**
911925
* @method registerListener
912926
* Applies an event listener. This listener will be automatically cleaned up

0 commit comments

Comments
 (0)