b4c3bf3b587ea6f9b1909624a859a72979e65665Matt SweeneyYUI.add('sortable-scroll', function(Y) {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney /**
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * Plugin for sortable to handle scrolling lists.
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @module sortable
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @submodule sortable-scroll
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney */
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney /**
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * Plugin for sortable to handle scrolling lists.
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @class SortScroll
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @extends Base
bf1e3b2d6315ca1b70d88d36fa5682255b0ea382Matt Sweeney * @constructor
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @namespace Plugin
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney */
edb19bbd929e4253f49411d899fcfbd9084df4baMatt Sweeney
edb19bbd929e4253f49411d899fcfbd9084df4baMatt Sweeney var SortScroll = function() {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney SortScroll.superclass.constructor.apply(this, arguments);
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney };
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney Y.extend(SortScroll, Y.Base, {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney initializer: function() {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney var host = this.get('host');
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney host.plug(Y.Plugin.DDNodeScroll, {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney node: host.get('container')
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney });
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney host.delegate.on('drop:over', function(e) {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney if (this.dd.nodescroll && e.drag.nodescroll) {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney e.drag.nodescroll.set('parentScroll', Y.one(this.get('container')));
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney }
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney });
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney }
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney }, {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney ATTRS: {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney host: {
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney value: ''
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney }
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney },
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney /**
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @property NAME
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @default SortScroll
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @readonly
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @protected
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @static
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @description The name of the class.
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @type {String}
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney */
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney NAME: 'SortScroll',
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney /**
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @property NS
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @default scroll
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @readonly
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @protected
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @static
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @description The scroll instance.
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney * @type {String}
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney */
d2b3a07a3d96abc2b64b178d3e6981ddd55891c7Matt Sweeney NS: 'scroll'
d2b3a07a3d96abc2b64b178d3e6981ddd55891c7Matt Sweeney });
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney Y.namespace('Y.Plugin');
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney Y.Plugin.SortableScroll = SortScroll;
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney}, '@VERSION@' ,{requires:['sortable', 'dd-scroll']});
b4c3bf3b587ea6f9b1909624a859a72979e65665Matt Sweeney