From 6abfa75e909be774c2e52e3442c08507f64c1419 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Sun, 31 Aug 2014 13:14:48 +0200 Subject: [PATCH] =?utf8?q?Insertion=20s=C3=A9lection=20apr=C3=A8s=20la=20c?= =?utf8?q?ible.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/photo_lightbox_viewer.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/skins/photo_lightbox_viewer.js b/skins/photo_lightbox_viewer.js index e7907ca..cffa157 100644 --- a/skins/photo_lightbox_viewer.js +++ b/skins/photo_lightbox_viewer.js @@ -468,9 +468,10 @@ Lightbox.prototype.onDragStart = function(evt) { var target = getTargetedObject(evt); this.dragged = target; this.draggedSelection = this.getSelectedSlides(); - this.draggedSelection.push(target); + if (this.draggedSelection.indexOf(target) === -1) { + this.draggedSelection.push(target); + } evt.dataTransfer.setData('text', ''); - var i, slide; for(i=0 ; i=0 ; i--) { + console.log(i); + slide = this.draggedSelection[i].cloneNode(true); + this.grid.insertBefore(slide, this.previousDragOver.nextSibling); + slide.style.opacity = 1; + slide.style.width = ''; + } } this.draggedSelection = this.previousDragOver = this.dragged = undefined; }; -- 2.20.1