var spinner = createSpinner();
visualize({
auth: {
name: "superuser",
password: "superuser"
}
}, function (v) {
var button = $("button");
var report = v.report({
resource: "/public/viz/Slow_Report/Slow_Report",
container: "#container",
events: {
changeTotalPages : function(){
spinner.remove();
}
}
});
button.click(function () {
report
.cancel()
.then(function () {
spinner.remove();
alert("Report Canceled!");
})
.fail(function () {
alert("Can't Cancel Report");
});
});
});
function createSpinner() {
var opts = {
lines: 17, // The number of lines to draw
length: 3, // The length of each line
width: 2, // The line thickness
radius: 3, // The radius of the inner circle
corners: 0.6, // Corner roundness (0..1)
rotate: 0, // The rotation offset
direction: 1, // 1: clockwise, -1: counterclockwise
color: '#000', // #rgb or #rrggbb or array of colors
speed: 1, // Rounds per second
trail: 60, // Afterglow percentage
shadow: false, // Whether to render a shadow
hwaccel: false, // Whether to use hardware acceleration
className: 'spinner', // The CSS class to assign to the spinner
zIndex: 2e9, // The z-index (defaults to 2000000000)
top: 'auto', // Top position relative to parent in px
left: 'auto' // Left position relative to parent in px
};
var container = $("#spinner");
var spinner = new Spinner(opts).spin(container[0]);
return container;
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.