Skip to content

Commit

Permalink
Puente
Browse files Browse the repository at this point in the history
Arreglando posiciones…
  • Loading branch information
siarcarse committed Apr 9, 2015
1 parent a8bf176 commit f671a02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion css/base.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.diente {
position: relative;
position: static;
width: 0px;
height: auto;
margin-left: 50px;
Expand Down
12 changes: 9 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ <h3 class="panel-title">Odontograma</h3>
});
break;
case "puente":
var dientePosition = $(this).position(), leftPX;
var dientePosition = $(this).offset(), leftPX;
console.log($(this)[0].offsetLeft)
var noDiente = $(this).parent().children().first().text();
var cuadrante = $(this).parent().parent().attr('id');
var left = 0,
Expand All @@ -259,13 +260,15 @@ <h3 class="panel-title">Odontograma</h3>
arrayPuente.push({
diente: noDiente,
cuadrante: cuadrante,
left: $(this)[0].offsetLeft,
father: null
});
} else {
$(this).parent().children('.cuadro').css('border-color', 'red');
arrayPuente.push({
diente: noDiente,
cuadrante: cuadrante,
left: $(this)[0].offsetLeft,
father: arrayPuente[0].diente
});
var diferencia = Math.abs((parseInt(arrayPuente[1].diente) - parseInt(arrayPuente[1].father)));
Expand All @@ -275,9 +278,11 @@ <h3 class="panel-title">Odontograma</h3>
if(arrayPuente[0].cuadrante == arrayPuente[1].cuadrante) {
if(arrayPuente[0].cuadrante == 'tr' || arrayPuente[0].cuadrante == 'tlr' || arrayPuente[0].cuadrante == 'br' || arrayPuente[0].cuadrante == 'blr') {
if (arrayPuente[0].diente > arrayPuente[1].diente) {
leftPX = "-45px";
console.log(arrayPuente[0])
leftPX = (parseInt(arrayPuente[0].left)+10)+"px";
}else {
leftPX = "45px";
leftPX = (parseInt(arrayPuente[1].left)+10)+"px";
//leftPX = "45px";
}
}else {
if (arrayPuente[0].diente < arrayPuente[1].diente) {
Expand All @@ -287,6 +292,7 @@ <h3 class="panel-title">Odontograma</h3>
}
}
}
console.log(leftPX)
/*$(this).parent().append('<div style="z-index: 9999; height: 5px; width:' + width + 'px;" id="puente" class="click-red"></div>');
$(this).parent().children().last().css({
"position": "absolute",
Expand Down

0 comments on commit f671a02

Please sign in to comment.