Skip to content

publicocean0/onremoval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

onRemoval

This component permits to detect when a dom node is removed directly or indirectly removing a parent node.

It is suggested to use bindep tool for including this component.Anyway it works also in standard bower. Bindep default preprocessor context is:

useListener=true

global scope api

(useListener=false in preprocessor or no preprocessing)

DOM node callback This is a utility callback for detecting when a dom node is removed.

onRemoval(el,function(el){
console.log('removing1') 
})
onRemoval(el,function(el){
console.log('executing ....') 
})

offRemoval(el) // you can pass directly the callback to remove


listener api

(useListener=true in preprocessor or no preprocessing)

DOM node callback This is a utility callback for detecting when a dom node is removed.

el.addEventListener('removal',function(el){
console.log('removing1') 
})
el.addEventListener('removal',function(el){
console.log('executing ....') 
})

el.removeEventListener('removal') // you can pass directly the callback to remove