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