Skip to content

Commit

Permalink
Simplify Javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed May 14, 2016
1 parent c8b2021 commit bddb2eb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions uber.js
Expand Up @@ -29,16 +29,11 @@ $( document ).ready(function() {
$( ".input" ).change(function() {
var miles = $("#miles").val();
var minutes = $("#minutes").val();
var total = {
X: 0,
XL: 0,
Ex: 0,
Lx: 0,
};
var total = {};
if ($.isNumeric(miles) && $.isNumeric(minutes)) {
$.each(rates, function( type, vals ) {
$("#" + type + "-Base").text(vals["Base"].toFixed(2));
total[type] += vals["Base"];
total[type] = vals["Base"];

calc_miles = vals["Mile"] * miles;
$("#" + type + "-Mile").text(calc_miles.toFixed(2));
Expand Down

0 comments on commit bddb2eb

Please sign in to comment.