Some new help functions, some cleanup.

This commit is contained in:
James Cole
2014-11-28 14:12:16 +01:00
parent 98993cfa9b
commit f6afb46f6f
12 changed files with 132 additions and 65 deletions

View File

@@ -0,0 +1,21 @@
$(function () {
$('#help').click(showHelp);
});
function showHelp(e) {
target = $(e.target);
route = target.data('route');
//
$('#helpBody').html('<i class="fa fa-refresh fa-spin"></i>');
$('#helpTitle').html('Please hold...');
$('#helpModal').modal('show');
$.getJSON('help/' + encodeURI(route)).success(function (data) {
$('#helpBody').html(data.text);
$('#helpTitle').html(data.title);
}).fail(function () {
$('#helpBody').html('<p class="text-danger">No help text could be found.</p>');
$('#helpTitle').html('Sorry...');
});
return false;
}