Permalink
Browse files

improve documentation

  • Loading branch information...
1 parent 8dd14ab commit 7483df179a5c09eda3a82e5eadde42cc56b4e153 @chemerisuk committed Jun 18, 2014
Showing with 12 additions and 14 deletions.
  1. +0 −4 extra/modules.json
  2. +3 −8 src/dom.extend.js
  3. +1 −0 src/dom.ready.js
  4. +0 −2 src/element.set.js
  5. +1 −0 src/element.style.js
  6. +7 −0 src/node.functional.js
View
@@ -50,9 +50,5 @@
"css": {
"title": "Changing of element styles support",
"files": ["src/element.style.js"]
- },
- "extend": {
- "title": "Live extensions support",
- "files": ["src/dom.extend.js"]
}
}
View
@@ -3,12 +3,6 @@ import DOM from "./dom";
import $Element from "./element";
import SelectorMatcher from "./selectormatcher";
-/**
- * Live extensions support
- * @module extend
- * @see https://github.com/chemerisuk/better-dom/wiki/Live-extensions
- */
-
// Inspired by trick discovered by Daniel Buchner:
// https://github.com/csuwldcat/SelectorListener
var reRemovableMethod = /^(on|do)[A-Z]/,
@@ -114,10 +108,11 @@ if (document.attachEvent ? readyState === "complete" : readyState !== "loading")
/**
* Declare a live extension
- * @memberOf module:extend
+ * @memberOf DOM
* @param {String} selector css selector of which elements to capture
* @param {Boolean|Function} [condition=true] indicates if live extension should be attached or not
* @param {Object} mixins extension declatation
+ * @see https://github.com/chemerisuk/better-dom/wiki/Live-extensions
*/
DOM.extend = function(selector, condition, mixins) {
if (arguments.length === 2) {
@@ -165,7 +160,7 @@ DOM.extend = function(selector, condition, mixins) {
/**
* Return {@link $Element} initialized with all existing live extensions.
* Also exposes private event handler functions that aren't usually presented
- * @memberOf module:extend
+ * @memberOf DOM
* @param {Mixed} [content] HTMLString, EmmetString
* @param {Object|Array} [varMap] key/value map of variables in emmet template
* @return {$Element} mocked instance
View
@@ -30,6 +30,7 @@ if (document.attachEvent ? readyState === "complete" : readyState !== "loading")
* Execute callback when DOM is ready
* @memberOf DOM
* @param {Function} callback event listener
+ * @deprecated use DOM.extend instead
*/
DOM.ready = function(callback) {
if (typeof callback !== "function") throw _.makeError("ready", true);
View
@@ -31,8 +31,6 @@ $Element.prototype.set = function(name, value) {
} else {
if (typeof newValue === "function") newValue = value(el, index, ref);
- if (window.stop) debugger;
-
if (hook) {
hook(node, newValue);
} else if (nameType !== "string") {
View
@@ -13,6 +13,7 @@ import CSS from "./css";
* @param {String|Object} name style property name or key/value object
* @param {String|Function} [value] style property value or function that returns it
* @return {String|$Element} property value or reference to this
+ * @deprecated use getter and setter instead
*/
$Element.prototype.style = function(name, value) {
var len = arguments.length,
View
@@ -22,6 +22,7 @@ var reInvoke = /cb\.call\(([^)]+)\)/g,
/**
* Execute callback on each element in the collection
+ * @memberOf $Node.prototype
* @param {Function} callback function that accepts (element, index, self)
* @param {Object} [context] callback context
* @return {$Node}
@@ -33,6 +34,7 @@ $Node.prototype.each = makeLoopMethod({
/**
* Check if the callback returns true for any element in the collection
+ * @memberOf $Node.prototype
* @param {Function} callback function that accepts (element, index, self)
* @param {Object} [context] callback context
* @return {Boolean} true, if any element in the collection return true
@@ -45,6 +47,7 @@ $Node.prototype.some = makeLoopMethod({
/**
* Check if the callback returns true for all elements in the collection
+ * @memberOf $Node.prototype
* @param {Function} callback function that accepts (element, index, self)
* @param {Object} [context] callback context
* @return {Boolean} true, if all elements in the collection returns true
@@ -58,6 +61,7 @@ $Node.prototype.every = makeLoopMethod({
/**
* Create an array of values by running each element in the collection through the callback
+ * @memberOf $Node.prototype
* @param {Function} callback function that accepts (element, index, self)
* @param {Object} [context] callback context
* @return {Array} new array of the results of each callback execution
@@ -71,6 +75,7 @@ $Node.prototype.map = makeLoopMethod({
/**
* Examine each element in a collection, returning an array of all elements the callback returns truthy for
+ * @memberOf $Node.prototype
* @param {Function} callback function that accepts (element, index, self)
* @param {Object} [context] callback context
* @return {Array} new array with elements where callback returned true
@@ -84,6 +89,7 @@ $Node.prototype.filter = makeLoopMethod({
/**
* Boil down a list of values into a single value (from start to end)
+ * @memberOf $Node.prototype
* @param {Function} callback function that accepts (memo, element, index, self)
* @param {Object} [memo] initial value of the accumulator
* @return {Object} the accumulated value
@@ -97,6 +103,7 @@ $Node.prototype.reduce = makeLoopMethod({
/**
* Boil down a list of values into a single value (from end to start)
+ * @memberOf $Node.prototype
* @param {Function} callback function that accepts (memo, element, index, self)
* @param {Object} [memo] initial value of the accumulator
* @return {Object} the accumulated value

0 comments on commit 7483df1

Please sign in to comment.