node-screen.js revision 983e81488c932da470ba33ef46964c7b6b7cfc00
/**
* Extended Node interface for managing regions and screen positioning.
* Adds support for positioning elements and normalizes window size and scroll detection.
* @module node
* @submodule node-screen
* @for Node
*/
// these are all "safe" returns, no wrapping required
Y.each([
/**
* Returns the inner width of the viewport (exludes scrollbar).
* @attribute winWidth
* @for Node
* @type {Int}
*/
'winWidth',
/**
* Returns the inner height of the viewport (exludes scrollbar).
* @attribute winHeight
* @type {Int}
*/
'winHeight',
/**
* Document width
* @attribute winHeight
* @type {Int}
*/
'docWidth',
/**
* Document height
* @attribute docHeight
* @type {Int}
*/
'docHeight',
/**
* Amount page has been scroll vertically
* @attribute docScrollX
* @type {Int}
*/
'docScrollX',
/**
* Amount page has been scroll horizontally
* @attribute docScrollY
* @type {Int}
*/
'docScrollY'
],
function(name) {
getter: function() {
}
};
}
);
getter: function() {
},
if (node) {
if ('scrollLeft' in node) {
}
} else {
}
}
};
getter: function() {
},
if (node) {
if ('scrollTop' in node) {
}
} else {
}
}
};
/**
* Gets the current position of the node in page coordinates.
* Nodes must be part of the DOM tree to have page coordinates
* (display:none or nodes not appended return false).
* @method getXY
* @for Node
* @return {Array} The XY position of the node
*/
'getXY',
/**
* Set the position of the node in page coordinates, regardless of how the node is positioned.
* The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @method setXY
* @param {Array} xy Contains X & Y values for new position (coordinates are page-based)
* @chainable
*/
'setXY',
/**
* Gets the current position of the node in page coordinates.
* Nodes must be part of the DOM tree to have page coordinates
* (display:none or nodes not appended return false).
* @method getX
* @return {Int} The X position of the node
*/
'getX',
/**
* Set the position of the node in page coordinates, regardless of how the node is positioned.
* The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @method setX
* @param {Int} x X value for new position (coordinates are page-based)
* @chainable
*/
'setX',
/**
* Gets the current position of the node in page coordinates.
* Nodes must be part of the DOM tree to have page coordinates
* (display:none or nodes not appended return false).
* @method getY
* @return {Int} The Y position of the node
*/
'getY',
/**
* Set the position of the node in page coordinates, regardless of how the node is positioned.
* The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
* @method setY
* @param {Int} y Y value for new position (coordinates are page-based)
* @chainable
*/
'setY'
]);