Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3948 → Rev 3949

/trunk/widget/modules/photo/squelettes/js/WidgetPhotoPopup.js
47,6 → 47,7
this.fournirLienIdentiplante();
this.traiterVote();
this.pivoterImage();
// this.pivoterGauche();
};
 
WidgetPhotoPopup.prototype.mettreAJourInfosImage = function() {
700,9 → 701,6
};
 
WidgetPhotoPopup.prototype.traiterVote = function () {
// console.log(this.idImage);
// console.log(this);
// console.log(this.tagsImage);
 
$("#note").attr("value", -1);
 
756,35 → 754,37
};
 
WidgetPhotoPopup.prototype.pivoterImage = function() {
let imageSelected = $('img[src="' + this.urlThisImage + '"]').attr('id');
 
$( '#pivoter-droite' ).on( 'click', function( event ) {
lthis = this;
$( '#pivoter-droite' ).off( 'click' ).on( 'click', function( event ) {
event.preventDefault();
 
let existingAngle = $('#' + imageSelected).data('angle');
if (existingAngle == 360 || existingAngle == (-360) || existingAngle == undefined){
existingAngle = 0
}
 
let angle = (existingAngle + 90);
$('#' + imageSelected).css("transform", "rotate(" + angle + "deg) ");
$('#' + imageSelected).data('angle', angle);
lthis.pivoter('droite');
});
 
$( '#pivoter-gauche' ).on( 'click', function( event ) {
$( '#pivoter-gauche' ).off( 'click' ).on( 'click', function( event ) {
event.preventDefault();
 
let existingAngle = $('#' + imageSelected).data('angle');
if (existingAngle == 360 || existingAngle == (-360) || existingAngle == undefined){
existingAngle = 0
}
 
let angle = (existingAngle - 90);
$('#' + imageSelected).css("transform", "rotate(" + angle + "deg) ");
$('#' + imageSelected).data('angle', angle);
lthis.pivoter('gauche');
});
};
 
WidgetPhotoPopup.prototype.pivoter = function(direction) {
let imageSelected = $('img[src="' + lthis.urlThisImage + '"]').attr('id');
let angle = $('#' + imageSelected).data('angle');
 
if (angle == 360 || angle == (-360) || angle == undefined){
angle = 0
}
if (direction == 'droite'){
angle += 90;
} else {
angle -= 90;
}
$('#' + imageSelected).css("transform", "rotate(" + angle + "deg) ");
$('#' + imageSelected).data('angle', angle);
}
 
// WidgetPhotoPopup.prototype.afficherTags = function() {
// const lthis = this;
// const TAGS_BASE = [