/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* Represents a list of {@link CKEDITOR.dom.node} objects.
- * It's a wrapper for native nodes list.
+ * It is a wrapper for a native nodes list.
*
* var nodeList = CKEDITOR.document.getBody().getChildren();
* alert( nodeList.count() ); // number [0;N]
CKEDITOR.dom.nodeList.prototype = {
/**
- * Get count of nodes in this list.
+ * Gets the count of nodes in this list.
*
* @returns {Number}
*/
},
/**
- * Get node from the list.
+ * Gets the node from the list.
*
* @returns {CKEDITOR.dom.node}
*/
var $node = this.$[ index ];
return $node ? new CKEDITOR.dom.node( $node ) : null;
+ },
+
+ /**
+ * Returns a node list as an array.
+ *
+ * @returns {CKEDITOR.dom.node[]}
+ */
+ toArray: function() {
+ return CKEDITOR.tools.array.map( this.$, function( nativeEl ) {
+ return new CKEDITOR.dom.node( nativeEl );
+ } );
}
};