BathHacked/energy-sparks

View on GitHub
app/assets/javascripts/aggregated_meter_collection.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";

$(document).ready(function() {
  if ($(".aggregated-meter-collection-loader").length) {
    // Post to controller
    $(".aggregated-meter-collection-loader .error").hide();
    $.post($('.aggregated-meter-collection-loader').data('aggregation-path'), function(data) {
      window.location.reload(true)
    }).fail(function() {
      $(".aggregated-meter-collection-loader .stats").hide();
      $(".aggregated-meter-collection-loader .error").show();

    });
  }
});