diff options
Diffstat (limited to 'modules/digibug/js/digibug.js')
-rw-r--r-- | modules/digibug/js/digibug.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/digibug/js/digibug.js b/modules/digibug/js/digibug.js new file mode 100644 index 00000000..f30678c0 --- /dev/null +++ b/modules/digibug/js/digibug.js @@ -0,0 +1,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(); + } + } + }); +}; |