var layers = [];
$('#linkeditor-links .link:not(.pendingCreate)').each(function () {
let type = $(this).attr('fb-type');
- let dest;
- switch (type) {
- case '6':
- dest = $(this).attr('fb-alternative');
- break;
- default:
- dest = $(this).attr('fb-to');
- }
+ let dest = $(this).attr('fb-to');
if (dest === '') {
dest = '<em>' + TRANSLATIONS.empty + '</em>';
}
e.originalEvent.dataTransfer.dropEffect = "copy";
e.preventDefault();
}
+ $(document).on('dragenter', '#linkeditor-main', function (e) {
- $(document).on('dragententer dragover', '#linkeditor-main', function (e) {
+ // Prevent canvas being scrolled at the begining of the drag
+ $("#linkeditor-canvas").addClass('noscroll');
+ setTimeout(function () {
+ $("#linkeditor-canvas").removeClass('noscroll');
+ }, 2000);
+ commonDragAndDropEvent(e);
+ }).on('dragover', '#linkeditor-main', function (e) {
$('#linkeditor-main').addClass('dropfile');
commonDragAndDropEvent(e);
}).on('dragleave', '#linkeditor-main', function (e) {
success: function (response) {
$(link).attr('fb-to', response[0]);
$this.selectLink(link);
+ LINKS[uid].to = response[0];
+ $this.linkeditor.hasChanged(true);
}
});
$(this).removeClass('dragging');
$(l).addClass('selected');
this.linkeditor.form.updateLinkForm();
- this.lastSelectedLink = l;
+ if ($(l).is(':visible') && !$(l).is('.pendingCreate') && parseFloat($(l).attr('fb-width')) > 2 && parseFloat($(l).attr('fb-height')) > 2) {
+ this.lastSelectedLink = l;
+ }
this.updateSelection();
},