~bac/juju-gui/trunkcopy

« back to all changes in this revision

Viewing changes to lib/yui/build/sortable-scroll/sortable-scroll.js

  • Committer: kapil.foss at gmail
  • Date: 2012-07-13 18:45:59 UTC
  • Revision ID: kapil.foss@gmail.com-20120713184559-2xl7be17egsrz0c9
reshape

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
YUI 3.5.1 (build 22)
3
 
Copyright 2012 Yahoo! Inc. All rights reserved.
4
 
Licensed under the BSD License.
5
 
http://yuilibrary.com/license/
6
 
*/
7
 
YUI.add('sortable-scroll', function(Y) {
8
 
 
9
 
    
10
 
    /**
11
 
     * Plugin for sortable to handle scrolling lists.
12
 
     * @module sortable
13
 
     * @submodule sortable-scroll
14
 
     */
15
 
    /**
16
 
     * Plugin for sortable to handle scrolling lists.
17
 
     * @class SortScroll
18
 
     * @extends Base
19
 
     * @constructor
20
 
     * @namespace Plugin     
21
 
     */
22
 
    
23
 
    var SortScroll = function() {
24
 
        SortScroll.superclass.constructor.apply(this, arguments);
25
 
    };
26
 
 
27
 
    Y.extend(SortScroll, Y.Base, {
28
 
        initializer: function() {
29
 
            var host = this.get('host');
30
 
            host.plug(Y.Plugin.DDNodeScroll, {
31
 
                node: host.get('container')
32
 
            });
33
 
            host.delegate.on('drop:over', function(e) {
34
 
                if (this.dd.nodescroll && e.drag.nodescroll) {
35
 
                    e.drag.nodescroll.set('parentScroll', Y.one(this.get('container')));
36
 
                }
37
 
            });
38
 
        }
39
 
    }, {
40
 
        ATTRS: {
41
 
            host: {
42
 
                value: ''
43
 
            }
44
 
        },
45
 
        /**
46
 
        * @property NAME
47
 
        * @default SortScroll
48
 
        * @readonly
49
 
        * @protected
50
 
        * @static
51
 
        * @description The name of the class.
52
 
        * @type {String}
53
 
        */
54
 
        NAME: 'SortScroll',
55
 
        /**
56
 
        * @property NS
57
 
        * @default scroll
58
 
        * @readonly
59
 
        * @protected
60
 
        * @static
61
 
        * @description The scroll instance.
62
 
        * @type {String}
63
 
        */
64
 
        NS: 'scroll'
65
 
    });
66
 
 
67
 
 
68
 
    Y.namespace('Y.Plugin');
69
 
    Y.Plugin.SortableScroll = SortScroll;
70
 
 
71
 
 
72
 
 
73
 
}, '3.5.1' ,{requires:['sortable', 'dd-scroll']});