Skip to main content

Bug Tracker

Side navigation

#1308 closed enhancement (wontfix)

Opened June 20, 2007 04:37AM UTC

Closed March 31, 2008 02:20AM UTC

allow multiple accept classes for droppables

Reported by: brett Owned by: stefan
Priority: minor Milestone: 1.2
Component: interface Version: 1.1.2
Keywords: droppable Cc:
Blocked by: Blocking:

could interface.droppable be enhanced to allow multiple classes for the accept parameter?

similar to scriptaculous: ("Set accept to a string or an array of strings describing CSS classes. The Droppable will only accept Draggables that have one or more of these CSS classes.")

Attachments (0)
Change History (2)

Changed June 27, 2007 04:25AM UTC by brett comment:1

I made what I think is a simple change to idrop.js (latest version) to facilitate multiple drop classes.

Basically, dropCfg.a becomes an array in function "build", and when drag starts iterate over all accept classes.

this.dropCfg = {
	a : (typeof(o.accept) == 'string') ? [o.accept] : o.accept, //MODIFIED
	ac: o.activeclass||false,

and then from about line 87 becomes:

if (jQuery.iDrop.zones[i] != null) {
	var iEL = jQuery.iDrop.zones[i].get(0);
	jQuery.each(iEL.dropCfg.a, function (n, a){ //NEW
		if (jQuery(jQuery.iDrag.dragged).is('.' + a)) { //MODIFIED
			if (iEL.dropCfg.m == false) {
				iEL.dropCfg.p = jQuery.extend(
				iEL.dropCfg.m = true;
			if ( {
			jQuery.iDrop.highlighted[i] = jQuery.iDrop.zones[i];
			//if (jQuery.iSort && {
			if (jQuery.iSort && iEL.dropCfg.s && {
				iEL.dropCfg.el = jQuery('.' + iEL.dropCfg.a, iEL); = 'none';
				iEL.dropCfg.os = jQuery.iSort.serialize(jQuery.attr(iEL, 'id')).hash; = elm.dragCfg.oD;
				oneIsSortable = true;
			if (iEL.dropCfg.onActivate) {
				iEL.dropCfg.onActivate.apply(jQuery.iDrop.zones[i].get(0), [jQuery.iDrag.dragged]);
	}); //NEW

If it's a good idea, I'd be happy to see this go into core - if not then my feelings won't be hurt.

Changed March 31, 2008 02:20AM UTC by scott.gonzal comment:2

resolution: → wontfix
status: newclosed

Interface is no longer supported; consider switching to jQuery UI.