Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correcting docs for inserted and removed events #148

Merged
merged 1 commit into from
Nov 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dom/events/inserted/inserted.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ var makeMutationEvent = require("../make-mutation-event/make-mutation-event");
* @module {events} can-util/dom/events/inserted/inserted inserted
* @parent can-util/dom/events/events
*
* This event fires when nodes are added as descendants of the attached element
* This event fires when the bound element is added to the DOM.
*
* ```js
* var events = require("can-util/dom/events/events");
* require("can-util/dom/events/inserted/inserted");
*
* var foo = document.createElement("div");
*
* var log = function() { console.log("inserted event fired"); }
* events.addEventListener(foo, "inserted", log);
* events.addEventListener.call(foo, "inserted", log);
*
* document.body.appendChild(foo); // inserted event fired
*/
makeMutationEvent("inserted", "addedNodes");
9 changes: 6 additions & 3 deletions dom/events/removed/removed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ var makeMutationEvent = require("../make-mutation-event/make-mutation-event");
* @module {events} can-util/dom/events/removed/removed removed
* @parent can-util/dom/events/events
*
* This event fires when descendant elements of the bound element are detached
* or destroyed.
* This event fires when the bound element is detached or destroyed.
*
* ```js
* var events = require("can-util/dom/events/events");
* require("can-util/dom/events/removed/removed");
*
* var foo = document.createElement("div");
* document.body.appendChild(foo);
*
* var log = function() { console.log("removed event fired"); }
* events.addEventListener(foo, "removed", log);
* events.addEventListener.call(foo, "removed", log);
*
* document.body.removeChild(foo); // remove event fired
*/
makeMutationEvent("removed", "removedNodes");