node-screen.js.html revision 4fcbec6145d16637205990699912fb90f6a3807c
<html>
<head>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<h3>node <span class="subtitle">3.00PR1</span></h3>
<p>
> node-screen.js (source view)
</p>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form name="yui-classopts-form">
<span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> <label for="showprivate">Show Private</label></span>
<span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> <label for="showprotected">Show Protected</label></span>
<span id="classopts"><input type="checkbox" name="showdeprecated" id="showdeprecated" /> <label for="showdeprecated">Show Deprecated</label></span>
</form>
<div id="srcout">
<style>
#doc3 #classopts { display:none; }
</style>
<div class="highlight" ><pre><span class="c">/**</span>
<span class="c"> * Extended Node interface for managing regions and screen positioning.</span>
<span class="c"> * Adds support for positioning elements and normalizes window size and scroll detection. </span>
<span class="c"> * @module node</span>
<span class="c"> * @submodule node-screen</span>
<span class="c"> * @for Node</span>
<span class="c"> */</span>
<span class="nx">Y</span><span class="o">.</span><span class="nx">each</span><span class="o">([</span>
<span class="s1">'winWidth'</span><span class="o">,</span>
<span class="s1">'winHeight'</span><span class="o">,</span>
<span class="s1">'docWidth'</span><span class="o">,</span>
<span class="s1">'docHeight'</span><span class="o">,</span>
<span class="s1">'docScrollX'</span><span class="o">,</span>
<span class="s1">'docScrollY'</span>
<span class="o">],</span>
<span class="k">function</span><span class="o">(</span><span class="nx">v</span><span class="o">,</span> <span class="nx">n</span><span class="o">)</span> <span class="o">{</span>
<span class="nx">Y</span><span class="o">.</span><span class="nx">Node</span><span class="o">.</span><span class="nx">getters</span><span class="o">(</span><span class="nx">v</span><span class="o">,</span> <span class="nx">Y</span><span class="o">.</span><span class="nx">Node</span><span class="o">.</span><span class="nx">wrapDOMMethod</span><span class="o">(</span><span class="nx">v</span><span class="o">));</span>
<span class="o">}</span>
<span class="o">);</span>
<span class="nx">Y</span><span class="o">.</span><span class="nx">Node</span><span class="o">.</span><span class="nx">addDOMMethods</span><span class="o">([</span>
<span class="c">/**</span>
<span class="c"> * Gets the current position of the node in page coordinates. </span>
<span class="c"> * Nodes must be part of the DOM tree to have page coordinates</span>
<span class="c"> * (display:none or nodes not appended return false).</span>
<span class="c"> * @method getXY</span>
<span class="c"> * @return {Array} The XY position of the node</span>
<span class="c"> */</span>
<span class="s1">'getXY'</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Set the position of a node in page coordinates, regardless of how the node is positioned.</span>
<span class="c"> * The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).</span>
<span class="c"> * @method setXY</span>
<span class="c"> * @param {Array} xy Contains X & Y values for new position (coordinates are page-based)</span>
<span class="c"> * @chainable</span>
<span class="c"> */</span>
<span class="s1">'setXY'</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Gets the current position of the node in page coordinates. </span>
<span class="c"> * Nodes must be part of the DOM tree to have page coordinates</span>
<span class="c"> * (display:none or nodes not appended return false).</span>
<span class="c"> * @method getX</span>
<span class="c"> * @return {Int} The X position of the node</span>
<span class="c"> */</span>
<span class="s1">'getX'</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Set the position of a node in page coordinates, regardless of how the node is positioned.</span>
<span class="c"> * The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).</span>
<span class="c"> * @method setX</span>
<span class="c"> * @param {Int} x X value for new position (coordinates are page-based)</span>
<span class="c"> * @chainable</span>
<span class="c"> */</span>
<span class="s1">'setX'</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Gets the current position of the node in page coordinates. </span>
<span class="c"> * Nodes must be part of the DOM tree to have page coordinates</span>
<span class="c"> * (display:none or nodes not appended return false).</span>
<span class="c"> * @method getY</span>
<span class="c"> * @return {Int} The Y position of the node</span>
<span class="c"> */</span>
<span class="s1">'getY'</span><span class="o">,</span>
<span class="c">/**</span>
<span class="c"> * Set the position of a node in page coordinates, regardless of how the node is positioned.</span>
<span class="c"> * The node must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).</span>
<span class="c"> * @method setY</span>
<span class="c"> * @param {Int} y Y value for new position (coordinates are page-based)</span>
<span class="c"> * @chainable</span>
<span class="c"> */</span>
<span class="s1">'setY'</span>
<span class="o">]);</span>
</pre></div>
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div class="module">
<h4>Modules</h4>
<ul class="content">
</ul>
</div>
<div class="module">
<h4>Classes</h4>
<ul class="content">
</ul>
</div>
<div class="module">
<h4>Files</h4>
<ul class="content">
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright © 2008 Yahoo! Inc. All rights reserved.
</div>
</div>
</body>
</html>