+if (browser.isGecko) {
+ Lightbox.prototype.disableDefaultDragging = function(element) {
+ if (!element) {
+ element = this.grid;
+ }
+ var i, j, name, elements;
+ var elementsNames = ['a', 'img'];
+ for (i=0 ; i < elementsNames.length ; i++) {
+ name = elementsNames[i];
+ elements = element.getElementsByTagName(name);
+ for (j=0 ; j < elements.length ; j++) {
+ elements[j].draggable=false;
+ }
+ }
+ };
+}
+else {
+ Lightbox.prototype.disableDefaultDragging = function() {};
+}
+
+
+Lightbox.prototype.onDragStart = function(evt) {
+ var target = getTargetedObject(evt);
+ this.dragged = target;
+ evt.dataTransfer.setData('text', '');
+ target.style.opacity = 0;
+ target.style.width = 0;
+};
+
+Lightbox.prototype.onDragOver = function(evt) {
+ var target = getTargetedObject(evt);
+ while(target.className !== 'slide') {
+ target = target.parentNode;
+ }
+ target = target.parentNode;
+ if (target !== this.dragged) {
+ target.classList.add('dragover');
+ }
+ if (this.previousDragOver && this.previousDragOver !== target) {
+ this.previousDragOver.classList.remove('dragover');
+ }
+ this.previousDragOver = target;
+};
+
+Lightbox.prototype.onDragEnd = function(evt) {
+ this.dragged.style.opacity = 1;
+ this.dragged.style.width = '';
+ if (this.previousDragOver) {
+ this.previousDragOver.classList.remove('dragover');
+ }
+ this.previousDragOver = this.dragged = undefined;
+};
+