/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/static/javascript/yui/build/anim/anim-scroll-debug.js

  • Committer: Jelmer Vernooij
  • Date: 2020-06-04 19:43:36 UTC
  • mto: This revision was merged to the branch mainline in revision 500.
  • Revision ID: jelmer@jelmer.uk-20200604194336-ahskrf4rmy1qaxzs
Port loggerhead from YUI to jQuery.

YUI has been deprecated since 2014 and is due to be removed from Debian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
3
 
Code licensed under the BSD License:
4
 
http://developer.yahoo.net/yui/license.txt
5
 
version: 3.0.0pr2
6
 
*/
7
 
YUI.add('anim-scroll', function(Y) {
8
 
 
9
 
/**
10
 
 * Adds support for the <code>scroll</code> property in <code>to</code>
11
 
 * and <code>from</code> attributes.
12
 
 * @module anim
13
 
 * @submodule anim-scroll
14
 
 * @for Anim
15
 
 */
16
 
 
17
 
var NUM = Number;
18
 
 
19
 
Y.Anim.behaviors.scroll = {
20
 
    set: function(anim, att, from, to, elapsed, duration, fn) {
21
 
        var
22
 
            node = anim._node, 
23
 
            val = ([
24
 
            fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),
25
 
            fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)
26
 
        ]);
27
 
 
28
 
        if (val[0]) {
29
 
            node.set('scrollLeft', val[0]);
30
 
        }
31
 
 
32
 
        if (val[1]) {
33
 
            node.set('scrollTop', val[1]);
34
 
        }
35
 
    },
36
 
    get: function(anim) {
37
 
        var node = anim._node;
38
 
        return [node.get('scrollLeft'), node.get('scrollTop')];
39
 
    }
40
 
};
41
 
 
42
 
 
43
 
 
44
 
}, '3.0.0pr2' ,{requires:['anim-base', 'node-base']});