Files
firefly-iii/public/js/ff/help.js

28 lines
743 B
JavaScript
Raw Normal View History

2015-02-06 07:23:26 +01:00
$(function () {
2015-05-24 18:22:41 +02:00
"use strict";
2015-02-06 07:23:26 +01:00
$('#help').click(showHelp);
$(function () {
2015-05-24 18:22:41 +02:00
2015-06-29 15:23:50 +02:00
//$('[data-toggle="tooltip"]').tooltip();
2015-05-24 18:22:41 +02:00
});
2015-02-06 07:23:26 +01:00
});
function showHelp(e) {
2015-05-24 18:22:41 +02:00
"use strict";
var target = $(e.target);
var route = target.data('route');
2015-02-06 07:23:26 +01:00
//
$('#helpBody').html('<i class="fa fa-refresh fa-spin"></i>');
$('#helpTitle').html('Please hold...');
$('#helpModal').modal('show');
2016-02-04 07:30:12 +01:00
$.getJSON('help/' + encodeURI(route)).done(function (data) {
2015-02-06 07:23:26 +01:00
$('#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;
}