|
|
|
@ -509,7 +509,13 @@ define(['backbone'], |
|
|
|
var targetModel = $dst.data('model'); |
|
|
|
var droppable = targetModel ? targetModel.get('droppable') : 1; |
|
|
|
|
|
|
|
if(targetCollection && droppable){ // TODO && targetModel.get('droppable')
|
|
|
|
// Check if the target could accept the element
|
|
|
|
var accepted = 1; |
|
|
|
if(droppable instanceof Array){ |
|
|
|
accepted = this.matches(src, droppable.join(', ')); |
|
|
|
} |
|
|
|
|
|
|
|
if(targetCollection && droppable && accepted){ // TODO && targetModel.get('droppable')
|
|
|
|
index = pos.method === 'after' ? index + 1 : index; |
|
|
|
var modelToDrop, modelTemp; |
|
|
|
var opts = {at: index, noIncrement: 1}; |
|
|
|
@ -531,8 +537,19 @@ define(['backbone'], |
|
|
|
// This will cause to recalculate children dimensions
|
|
|
|
this.prevTarget = null; |
|
|
|
return created; |
|
|
|
}else |
|
|
|
console.warn("Invalid target position"); |
|
|
|
}else{ |
|
|
|
var warns = []; |
|
|
|
if(!targetCollection){ |
|
|
|
warns.push('target collection not found'); |
|
|
|
} |
|
|
|
if(!droppable){ |
|
|
|
warns.push('target is not droppable'); |
|
|
|
} |
|
|
|
if(!accepted){ |
|
|
|
warns.push('target accepts only [' + droppable.join(', ') + ']'); |
|
|
|
} |
|
|
|
console.warn('Invalid target position: ' + warns.join(', ')); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -551,4 +568,4 @@ define(['backbone'], |
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|