From: Benoît Pin Date: Sun, 31 Aug 2014 11:14:48 +0000 (+0200) Subject: Insertion sélection après la cible. X-Git-Url: https://scm.cri.mines-paristech.fr/git/Portfolio.git/commitdiff_plain/6abfa75e909be774c2e52e3442c08507f64c1419?ds=inline;hp=-c Insertion sélection après la cible. --- 6abfa75e909be774c2e52e3442c08507f64c1419 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; };