front_idill/src/mosaic/js/zoomInteractions.js
changeset 55 afd60399a7b5
parent 52 277c94533395
child 58 a28488078053
--- a/front_idill/src/mosaic/js/zoomInteractions.js	Tue Jul 24 16:35:10 2012 +0200
+++ b/front_idill/src/mosaic/js/zoomInteractions.js	Thu Jul 26 14:34:02 2012 +0200
@@ -44,7 +44,7 @@
     //Dimensions de la mosaïque.
     var h = this.height, w = this.width;
     //Longueur en images, nombre d'images et taille de bordure de la mosaïque.
-    var len = this.config.length, imgs = this.config.imagesToShow, margin = this.marginWidth;
+    var len = this.config.imagesByLine, imgs = this.config.imagesToShow, margin = this.marginWidth;
     //Dimensions et position d'un snapshot dans la mosaïque.
     var snHeight = this.snapshotHeight, snWidth = this.snapshotWidth;
     var sTop = snapshot.position().top, sLeft = snapshot.position().left;
@@ -274,9 +274,15 @@
     {
         return;
     }
+	
+	//Si on est en mode d'interaction souris, on enlève la bordure d'aide.
+	if(this.config.mouseInteractions)
+	{
+		this.removeHelpIcon();
+	}
     
     //On prend les attributs nécessaires au calculs.
-    var margin = this.marginWidth, len = this.config.length, imgs = this.config.imagesToShow, zoomedMargin = this.config.zoomedMargin;
+    var margin = this.marginWidth, len = this.config.imagesByLine, imgs = this.config.imagesToShow, zoomedMargin = this.config.zoomedMargin;
     var zoomPercentage = this.config.zoomPercentage;
     var initMPWidth = this.previousZoomedSN.width() * len + margin*len, initMPHeight = this.previousZoomedSN.height() * (imgs / len) + margin*(imgs / len);
     var newMPWidth = initMPWidth * len + zoomedMargin * (len), newMPHeight = initMPHeight * (imgs / len) + zoomedMargin * ((imgs / len));
@@ -334,6 +340,12 @@
         left: newZoomLeft
     }, this.config.zoomTime, function()
     {
+		//Si on est en mode d'interaction souris, on affiche la bordure d'aide.
+		if(_this.config.mouseInteractions)
+		{
+			_this.helpIcon();
+		}
+		
         _this.snTop = (zoomedImg.position().top + newZoomTop + _this.MPTop_margin), _this.snLeft = (zoomedImg.position().left + newZoomLeft);
         _this.snWidth = newSnWidth + 1, _this.snHeight = newSnHeight + 1;
         
@@ -386,6 +398,12 @@
     }
     
     var _this = this;
+	
+	//Si on est en mode d'interaction souris, on enlève la bordure d'aide.
+	if(this.config.mouseInteractions)
+	{
+		this.removeHelpIcon();
+	}
     
     //Il n'est plus possible de swiper.
     this.canSwipe = false;
@@ -485,6 +503,12 @@
         left: '0px'
     }, this.config.unzoomTime, function()
     {
+		//Si on est en mode d'interaction souris, on affiche la bordure d'aide.
+		if(_this.config.mouseInteractions)
+		{
+			_this.helpIcon();
+		}
+		
         //On n'est plus en plein écran, et on ne peut plus se déplacer vers le prochain voisin.
         _this.fullscreen = false;
         _this.canMoveToNeighbour = false;