projects
/
Portfolio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e3e5d18
)
Déplacement de la sélection
author
Benoît Pin
<benoit.pin@gmail.com>
Sun, 31 Aug 2014 10:40:50 +0000
(12:40 +0200)
committer
Benoît Pin
<benoit.pin@gmail.com>
Sun, 31 Aug 2014 10:40:50 +0000
(12:40 +0200)
skins/photo_lightbox_viewer.js
patch
|
blob
|
history
diff --git
a/skins/photo_lightbox_viewer.js
b/skins/photo_lightbox_viewer.js
index
b67f6ab
..
e7907ca
100644
(file)
--- a/
skins/photo_lightbox_viewer.js
+++ b/
skins/photo_lightbox_viewer.js
@@
-451,13
+451,32
@@
else {
Lightbox.prototype.disableDefaultDragging = function() {};
}
Lightbox.prototype.disableDefaultDragging = function() {};
}
+Lightbox.prototype.getSelectedSlides = function() {
+ var i, e, slide;
+ var slides = [];
+ for (i=0 ; i<this.form.elements.length ; i++) {
+ e = this.form.elements[i];
+ if (e.type === 'checkbox' && e.checked) {
+ slide = e.parentNode.parentNode;
+ slides.push(slide);
+ }
+ }
+ return slides;
+};
Lightbox.prototype.onDragStart = function(evt) {
var target = getTargetedObject(evt);
this.dragged = target;
Lightbox.prototype.onDragStart = function(evt) {
var target = getTargetedObject(evt);
this.dragged = target;
+ this.draggedSelection = this.getSelectedSlides();
+ this.draggedSelection.push(target);
evt.dataTransfer.setData('text', '');
evt.dataTransfer.setData('text', '');
- target.style.opacity = 0;
- target.style.width = 0;
+
+ var i, slide;
+ for(i=0 ; i<this.draggedSelection.length ; i++) {
+ slide = this.draggedSelection[i];
+ slide.style.opacity = 0;
+ slide.style.width = 0;
+ }
};
Lightbox.prototype.onDragOver = function(evt) {
};
Lightbox.prototype.onDragOver = function(evt) {
@@
-476,12
+495,16
@@
Lightbox.prototype.onDragOver = function(evt) {
};
Lightbox.prototype.onDragEnd = function(evt) {
};
Lightbox.prototype.onDragEnd = function(evt) {
- this.dragged.style.opacity = 1;
- this.dragged.style.width = '';
if (this.previousDragOver) {
this.previousDragOver.classList.remove('dragover');
}
if (this.previousDragOver) {
this.previousDragOver.classList.remove('dragover');
}
- this.previousDragOver = this.dragged = undefined;
+ var i, slide;
+ for(i=0 ; i<this.draggedSelection.length ; i++) {
+ slide = this.draggedSelection[i];
+ slide.style.opacity = 1;
+ slide.style.width = '';
+ }
+ this.draggedSelection = this.previousDragOver = this.dragged = undefined;
};
}());
\ No newline at end of file
};
}());
\ No newline at end of file