MDL-35616 import YUI 3.7.2
[moodle.git] / lib / yuilib / 3.7.2 / build / anim-xy / anim-xy.js
blob93c1aadbd308736240f44dc9d34009357765ef69
1 /*
2 YUI 3.7.2 (build 5639)
3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
7 YUI.add('anim-xy', function (Y, NAME) {
9 /**
10  * Adds support for the <code>xy</code> property in <code>from</code> and 
11  * <code>to</code> attributes.
12  * @module anim
13  * @submodule anim-xy
14  */
16 var NUM = Number;
18 Y.Anim.behaviors.xy = {
19     set: function(anim, att, from, to, elapsed, duration, fn) {
20         anim._node.setXY([
21             fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
22             fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
23         ]);
24     },
25     get: function(anim) {
26         return anim._node.getXY();
27     }
32 }, '3.7.2', {"requires": ["anim-base", "node-screen"]});