Code cleanup.

This commit is contained in:
James Cole
2016-04-10 17:51:51 +02:00
parent ab523b6102
commit 32eeb3424d
99 changed files with 476 additions and 120 deletions

27
public/js/ff/help.js Normal file
View File

@@ -0,0 +1,27 @@
$(function () {
"use strict";
$('#help').click(showHelp);
$(function () {
//$('[data-toggle="tooltip"]').tooltip();
});
});
function showHelp(e) {
"use strict";
var target = $(e.target);
var 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)).done(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;
}