(js) Force copy of dragged contacts from remote AB

This commit is contained in:
Francis Lachapelle
2017-11-30 11:25:11 -05:00
parent 7ddecd4006
commit 8e1a19dca2
2 changed files with 7 additions and 2 deletions
@@ -120,7 +120,7 @@
$rootScope.$emit('folder:dragstart', this.folder);
}
if (this.dragHasStarted) {
if (ev.shiftKey)
if (ev.shiftKey || this.folder.isRemote)
this.helper.addClass('sg-draggable-helper--copy');
else
this.helper.removeClass('sg-draggable-helper--copy');
@@ -130,12 +130,16 @@
onDragEnd: function(ev) {
var action = 'move';
this.startPosition = null;
$document.off('mousemove', this.bindedOnDrag);
if (this.dragHasStarted) {
if (ev.shiftKey || this.folder.isRemote)
action = 'copy';
$log.debug('emit folder:dragend');
$rootScope.$emit('folder:dragend', this.folder, ev.shiftKey?'copy':'move');
$rootScope.$emit('folder:dragend', this.folder, action);
this.dragHasStarted = false;
this.helper.addClass('ng-hide');
}