Show and Update Weight without plates added
Shows the bar weight on page load. Added a script that updates the plates weights if no plate visuals exist.
This commit is contained in:
@@ -122,7 +122,6 @@ p.subheading {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 28px;
|
line-height: 28px;
|
||||||
letter-spacing: .015px;
|
letter-spacing: .015px;
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.b-platevisual__weight{
|
.b-platevisual__weight{
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
<div class="b-platevisual">
|
<div class="b-platevisual">
|
||||||
<div class="b-platevisual__container">
|
<div class="b-platevisual__container">
|
||||||
<div class="b-platevisual__weightfinalcontainer">
|
<div class="b-platevisual__weightfinalcontainer">
|
||||||
<p class="b-platevisual__weightfinal"><span class="input-element input-final">0</span> LBS</p>
|
<p class="b-platevisual__weightfinal"><span class="input-element input-final">45</span> LBS</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="b-platevisual__weight">
|
<div class="b-platevisual__weight">
|
||||||
<img src="images/BarBell.svg" class="b-platevisual__barbell">
|
<img src="images/BarBell.svg" class="b-platevisual__barbell">
|
||||||
|
|||||||
@@ -174,10 +174,12 @@
|
|||||||
|
|
||||||
//reset inputs and plate visuals
|
//reset inputs and plate visuals
|
||||||
jQuery(".b-infoentry__reset").click(function(){
|
jQuery(".b-infoentry__reset").click(function(){
|
||||||
|
var bar = jQuery(".input-bar").val();
|
||||||
jQuery(".input-weight, .input-weightsneeded").val('');
|
jQuery(".input-weight, .input-weightsneeded").val('');
|
||||||
jQuery(".input-final, .input-difference").html('0');
|
jQuery(".input-final, .input-difference").html(bar);
|
||||||
animatePlatesOut();
|
animatePlatesOut();
|
||||||
jQuery(".b-infoentry__reset, .b-platevisual__weightfinal, .b-platevisual__weightdifference").hide();
|
jQuery(".b-platevisual__plates").html("");
|
||||||
|
jQuery(".b-infoentry__reset, .b-platevisual__weightdifference").hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
//Saves scroll position on focus and restores
|
//Saves scroll position on focus and restores
|
||||||
@@ -200,4 +202,16 @@
|
|||||||
jQuery(".input-weight").on('blur', function(){
|
jQuery(".input-weight").on('blur', function(){
|
||||||
restoreScroll()
|
restoreScroll()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Updates Bar Weight if plate visuals do not exist.
|
||||||
|
jQuery(".input-bar").on("change", function() {
|
||||||
|
var bar = jQuery(".input-bar").val();
|
||||||
|
if (jQuery('.b-platevisual__plate').length == 0){
|
||||||
|
jQuery(".input-final").html(bar);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user