can-dom-mutate
Advanced tools
Comparing version 1.0.1 to 1.0.2
10
-util.js
@@ -0,1 +1,3 @@ | ||
var getDocument = require("can-globals/document/document"); | ||
var push = Array.prototype.push; | ||
@@ -11,3 +13,3 @@ | ||
function isInDocument (node) { | ||
var root = node.ownerDocument.documentElement; | ||
var root = getDocument().documentElement; | ||
if (root === node) { | ||
@@ -19,8 +21,4 @@ return true; | ||
function getDocument(target) { | ||
return target.ownerDocument || target.document || target; | ||
} | ||
function isDocumentElement (node) { | ||
return getDocument(node).documentElement === node; | ||
return getDocument().documentElement === node; | ||
} | ||
@@ -27,0 +25,0 @@ |
@@ -85,3 +85,3 @@ 'use strict'; | ||
function getDocumentListeners (target, key) { | ||
var doc = getDocument(target); | ||
var doc = getDocument(); | ||
var data = getRelatedData(doc, key); | ||
@@ -94,3 +94,3 @@ if (data) { | ||
function getTargetListeners (target, key) { | ||
var doc = getDocument(target); | ||
var doc = getDocument(); | ||
var targetListenersMap = getRelatedData(doc, key); | ||
@@ -105,3 +105,3 @@ if (!targetListenersMap) { | ||
function addTargetListener (target, key, listener) { | ||
var doc = getDocument(target); | ||
var doc = getDocument(); | ||
var targetListenersMap = getRelatedData(doc, key); | ||
@@ -121,3 +121,3 @@ if (!targetListenersMap) { | ||
function removeTargetListener (target, key, listener) { | ||
var doc = getDocument(target); | ||
var doc = getDocument(); | ||
var targetListenersMap = getRelatedData(doc, key); | ||
@@ -267,3 +267,3 @@ if (!targetListenersMap) { | ||
} else { | ||
stopObserving = observeMutations(getDocument(target), observerKey, treeMutationConfig, handleTreeMutations); | ||
stopObserving = observeMutations(getDocument(), observerKey, treeMutationConfig, handleTreeMutations); | ||
} | ||
@@ -285,3 +285,3 @@ | ||
var doc = getDocument(documentElement); | ||
var doc = getDocument(); | ||
var documentData = getRelatedData(doc, globalDataKey); | ||
@@ -288,0 +288,0 @@ if (!documentData) { |
{ | ||
"name": "can-dom-mutate", | ||
"description": "Dispatch and listen for DOM mutations", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "DoneJS Team", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50739
16
1173
1