From 9d15a219a1b6910463064c64f9c211c606b4b5eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Sun, 31 Aug 2014 21:44:36 +0200 Subject: [PATCH] =?utf8?q?Traitement=20de=20la=20r=C3=A9ponse=20http=20lor?= =?utf8?q?s=20d'un=20tri.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- skins/photo_lightbox_viewer.js | 33 ++++++++++++++++++++++++++++----- skins/portfolio_move_photos.py | 7 ++++++- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/skins/photo_lightbox_viewer.js b/skins/photo_lightbox_viewer.js index f4c4498..3c69aec 100644 --- a/skins/photo_lightbox_viewer.js +++ b/skins/photo_lightbox_viewer.js @@ -500,8 +500,10 @@ Lightbox.prototype.onDragEnd = function(evt) { if (this.lastDropTarget) { this.lastDropTarget.classList.remove('dragover'); var i, slide; + this.pendingMovedSlides = []; for(i=this.draggedSelection.length -1 ; i>=0 ; i--) { slide = this.draggedSelection[i].cloneNode(true); + this.pendingMovedSlides.push(slide); this.grid.insertBefore(slide, this.lastDropTarget.nextSibling); slide.style.opacity = 1; slide.style.width = ''; @@ -522,10 +524,7 @@ Lightbox.prototype.moveSelectedPhotos = function() { break; case 4 : hideProgressImage(); - if (req.status === 200) { - console.log(req.responseText); - // self._refreshGrid(req); - } + self._moveSelectedPhotos(req) break; } }; @@ -542,7 +541,31 @@ Lightbox.prototype.moveSelectedPhotos = function() { req.send(query); }; -Lightbox.prototype.moveSelectedPhoto = function() { +Lightbox.prototype._moveSelectedPhotos = function(req) { + var i, slide; + if (req.status === 200) { + var doc = req.responseXML.documentElement; + if (doc.nodeName === 'ok') { + this.pendingMovedSlides = undefined; + for(i=0 ; i' + except NotImplementedError : + raise return printed -- 2.20.1