Update chart UI, update Jquery
This commit is contained in:
Vendored
+19
-14
@@ -16,32 +16,37 @@
|
||||
};
|
||||
|
||||
var baseUrl = "/umbraco/surface/Chart/ChartCurve";
|
||||
var $chart = $("#chart");
|
||||
var $chartError = $('#chart-error');
|
||||
|
||||
$('#CurveId')
|
||||
.change(function () {
|
||||
$('#chart-error').removeClass('text-danger').text('');
|
||||
var $chart = $("#chart");
|
||||
$chart.removeAttr('src');
|
||||
$chartError.removeClass('text-danger').text('');
|
||||
|
||||
// this is the "Select CurveId" instruction
|
||||
if (this.selectedIndex === 0) {
|
||||
$chart.removeAttr('src');
|
||||
return;
|
||||
}
|
||||
|
||||
var curveId = $("option:selected", this).text();
|
||||
|
||||
var $spinner = $chart.after('<span class="glyphicon glyphicon-refresh gly-spin" style="font-size: 3em"></span>').next('span');
|
||||
$chart.after('<span class="glyphicon glyphicon-refresh gly-spin" style="font-size: 3em"></span>');
|
||||
|
||||
var leafInputId = getUrlParameter("leafInputId");
|
||||
var url = baseUrl + "?leafInputId=" + leafInputId + "&curveId=" + curveId;
|
||||
$chart.load(function () {
|
||||
$spinner.remove();
|
||||
})
|
||||
.error(function () {
|
||||
//$chart.removeAttr('src');
|
||||
$spinner.remove();
|
||||
$('#chart-error').addClass('text-danger').text('A problem was encountered loading this chart.');
|
||||
return;
|
||||
})
|
||||
.attr('src', url);
|
||||
|
||||
$chart.attr('src', url);
|
||||
});
|
||||
|
||||
$chart.load(function () {
|
||||
$chart.next('span.gly-spin').remove(); // remove spinner
|
||||
})
|
||||
.error(function () {
|
||||
$chart.next('span.gly-spin').remove(); // remove spinner
|
||||
if ($chart.attr('src') != undefined) {
|
||||
$chart.removeAttr('src');
|
||||
$chartError.addClass('text-danger').text('A problem was encountered loading this chart.');
|
||||
}
|
||||
});
|
||||
});
|
||||
Vendored
-4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+2687
-1987
File diff suppressed because it is too large
Load Diff
Vendored
+5
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user