Charts, login, manage queue, styling
This commit is contained in:
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
var getUrlParameter = function getUrlParameter(sParam) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||
sURLVariables = sPageURL.split('&'),
|
||||
sParameterName,
|
||||
i;
|
||||
|
||||
for (i = 0; i < sURLVariables.length; i++) {
|
||||
sParameterName = sURLVariables[i].split('=');
|
||||
|
||||
if (sParameterName[0] === sParam) {
|
||||
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$(function () {
|
||||
var baseUrl = "/umbraco/surface/Chart/ChartCurve";
|
||||
$('#CurveId')
|
||||
.change(function () {
|
||||
$('#chart-error').removeClass('text-danger').text('');
|
||||
var $chart = $("#chart");
|
||||
$chart.removeAttr('src');
|
||||
|
||||
var curveId = $("option:selected", this).text();
|
||||
if (curveId === "@Html.Raw(selectText)") {
|
||||
return;
|
||||
}
|
||||
var $spinner = $(this).after('<i class="fa fa-spinner fa-spin"></i>').next('i');
|
||||
|
||||
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.');
|
||||
})
|
||||
.attr('src', url);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user