NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / sortable-scroll / sortable-scroll.js
blobb8acf851e4e127edddb803f6ab58ec7f6ddb168e
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 YUI.add('sortable-scroll', function (Y, NAME) {
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      */
24     var SortScroll = function() {
25         SortScroll.superclass.constructor.apply(this, arguments);
26     };
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     });
69     Y.namespace('Y.Plugin');
70     Y.Plugin.SortableScroll = SortScroll;
74 }, '3.13.0', {"requires": ["dd-scroll", "sortable"]});