summaryrefslogtreecommitdiff
path: root/modules/digibug/js/digibug.js
blob: f30678c02dcd49aa6d014cd22fcf81b07fc3306f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$(document).ready(function() {
  $(".gDigibugPrintButton a").click(function(e) {
    e.preventDefault();
    queue_print(e);
  });
});

function queue_print(e) {
  var parent = e.currentTarget.parentNode;
  $(parent).addClass("gLoadingLarge");
  $.ajax({
    type: "GET",
    url: e.currentTarget.href,
    dataType: "json",
    success: function(data) {
      $(parent).removeClass("gLoadingLarge");
      if (data.location) {
        window.location = data.location;
      } else if (data.reload) {
        window.location.reload();
      }
    }
  });
};