mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 07:09:28 +03:00
Merge pull request #263 from kmels/pr-251-fix-broken-shortcut
hledger-web: Fixes keyboard shortcut for adding a transaction.
This commit is contained in:
commit
a06e612095
@ -34,7 +34,7 @@ getJournalR = do
|
|||||||
hledgerLayout vd "journal" [hamlet|
|
hledgerLayout vd "journal" [hamlet|
|
||||||
<h2#contenttitle>#{title}
|
<h2#contenttitle>#{title}
|
||||||
<!-- p>Journal entries record movements of commodities between accounts. -->
|
<!-- p>Journal entries record movements of commodities between accounts. -->
|
||||||
<a#addformlink role="button" style="cursor:pointer;" data-toggle="modal" data-target="#addmodal" title="Add a new transaction to the journal" style="margin-top:1em;">Add a transaction
|
<a#addformlink role="button" style="cursor:pointer;" onClick="addformReset(true);" data-toggle="modal" data-target="#addmodal" title="Add a new transaction to the journal" style="margin-top:1em;">Add a transaction
|
||||||
^{maincontent}
|
^{maincontent}
|
||||||
|]
|
|]
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// show add form if ?add=1
|
// show add form if ?add=1
|
||||||
if ($.url.param('add')) { addformShow(showmsg=true); }
|
if ($.url.param('add')) { addformShow(true); }
|
||||||
|
|
||||||
// sidebar account hover handlers
|
// sidebar account hover handlers
|
||||||
$('#sidebar td a').mouseenter(function(){ $(this).parent().addClass('mouseover'); });
|
$('#sidebar td a').mouseenter(function(){ $(this).parent().addClass('mouseover'); });
|
||||||
@ -127,7 +127,7 @@ function registerChartClick(ev, pos, item) {
|
|||||||
// ADD FORM
|
// ADD FORM
|
||||||
|
|
||||||
function addformShow(showmsg) {
|
function addformShow(showmsg) {
|
||||||
showmsg = typeof showmsg !== 'undefined' ? a : false;
|
showmsg = typeof showmsg !== 'undefined' ? showmsg : false;
|
||||||
addformReset(showmsg);
|
addformReset(showmsg);
|
||||||
$('#addmodal')
|
$('#addmodal')
|
||||||
.on('shown.bs.modal', function (e) {
|
.on('shown.bs.modal', function (e) {
|
||||||
@ -138,7 +138,7 @@ function addformShow(showmsg) {
|
|||||||
|
|
||||||
// Make sure the add form is empty and clean for display.
|
// Make sure the add form is empty and clean for display.
|
||||||
function addformReset(showmsg) {
|
function addformReset(showmsg) {
|
||||||
showmsg = typeof showmsg !== 'undefined' ? a : false;
|
showmsg = typeof showmsg !== 'undefined' ? showmsg : false;
|
||||||
if ($('form#addform').length > 0) {
|
if ($('form#addform').length > 0) {
|
||||||
if (!showmsg) $('div#message').html('');
|
if (!showmsg) $('div#message').html('');
|
||||||
$('form#addform')[0].reset();
|
$('form#addform')[0].reset();
|
||||||
|
Loading…
Reference in New Issue
Block a user