Do not allow to drag an invalid email address in compose

This commit is contained in:
Hadi Nategh 2015-05-22 15:24:50 +00:00
parent 6e4432c6a4
commit 51fd95b69c

View File

@ -4140,10 +4140,17 @@ app.classes.mail = AppJS.extend(
});
}
var zIndex = 100;
var dragItem = jQuery('div.ms-sel-item:not(div.ui-draggable)');
if (dragItem.length > 0)
var dragItems = jQuery('div.ms-sel-item:not(div.ui-draggable)');
dragItems.each(function(i,item){
var $isErr = jQuery(item).find('.ui-state-error');
if ($isErr.length > 0)
{
delete dragItems.splice(i,1);
}
});
if (dragItems.length > 0)
{
dragItem.draggable({
dragItems.draggable({
appendTo:'body',
//Performance wise better to not add ui-draggable class to items since we are not using that class
containment:'document',
@ -4190,7 +4197,7 @@ app.classes.mail = AppJS.extend(
}).draggable('disable');
window.setTimeout(function(){
if(dragItem && dragItem.data() && typeof dragItem.data()['uiDraggable'] !== 'undefined') dragItem.draggable('enable');
if(dragItems && dragItems.data() && typeof dragItems.data()['uiDraggable'] !== 'undefined') dragItems.draggable('enable');
},100);
}
@ -4256,9 +4263,17 @@ app.classes.mail = AppJS.extend(
.removeClass('mailCompose_copyEmail')
.css('cursor','move');
}
var dragItems = jQuery('div.ms-sel-item');
dragItems.each(function(i,item){
var $isErr = jQuery(item).find('.ui-state-error');
if ($isErr.length > 0)
{
delete dragItems.splice(i,1);
}
});
//Destroy draggables after dropping, we need to enable them again
jQuery('div.ms-sel-item').draggable('destroy');
dragItems.draggable('destroy');
}
}
});