206
206
// these need special treatment to extract 2nd node arg
208
* Compares the intersection of the node with another node or region
208
* Compares the intersection of the node with another node or region
211
211
* @param {Node|Object} node2 The node or region to compare with.
212
* @param {Object} altRegion An alternate region to use (rather than this node's).
213
* @return {Object} An object representing the intersection of the regions.
212
* @param {Object} altRegion An alternate region to use (rather than this node's).
213
* @return {Object} An object representing the intersection of the regions.
215
215
Y.Node.prototype.intersect = function(node2, altRegion) {
216
216
var node1 = Y.Node.getDOMNode(this);
217
if (node2 instanceof Y.Node) { // might be a region object
217
if (Y.instanceOf(node2, Y.Node)) { // might be a region object
218
218
node2 = Y.Node.getDOMNode(node2);
220
return Y.DOM.intersect(node1, node2, altRegion);
220
return Y.DOM.intersect(node1, node2, altRegion);
224
224
* Determines whether or not the node is within the giving region.
226
226
* @param {Node|Object} node2 The node or region to compare with.
227
* @param {Boolean} all Whether or not all of the node must be in the region.
228
* @param {Object} altRegion An alternate region to use (rather than this node's).
229
* @return {Object} An object representing the intersection of the regions.
227
* @param {Boolean} all Whether or not all of the node must be in the region.
228
* @param {Object} altRegion An alternate region to use (rather than this node's).
229
* @return {Object} An object representing the intersection of the regions.
231
231
Y.Node.prototype.inRegion = function(node2, all, altRegion) {
232
232
var node1 = Y.Node.getDOMNode(this);
233
if (node2 instanceof Y.Node) { // might be a region object
233
if (Y.instanceOf(node2, Y.Node)) { // might be a region object
234
234
node2 = Y.Node.getDOMNode(node2);
236
return Y.DOM.inRegion(node1, node2, all, altRegion);
236
return Y.DOM.inRegion(node1, node2, all, altRegion);
240
}, '3.2.0' ,{requires:['dom-screen']});
240
}, '3.3.0' ,{requires:['dom-screen']});