mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Added keyboard shortcuts for add product/barcode dialogs
This commit is contained in:
parent
bd16b8c851
commit
fe8a6d96e4
@ -140,22 +140,32 @@ $(function()
|
||||
callback: function() { }
|
||||
},
|
||||
addnewproduct: {
|
||||
label: 'Add as new product',
|
||||
className: 'btn-success',
|
||||
label: 'Add as new <u><strong>p</strong></u>roduct',
|
||||
className: 'btn-success add-new-product-dialog-button',
|
||||
callback: function()
|
||||
{
|
||||
window.location.href = '/product/new?prefillname=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent(window.location.pathname);
|
||||
}
|
||||
},
|
||||
addbarcode: {
|
||||
label: 'Add as barcode to existing product',
|
||||
className: 'btn-info',
|
||||
label: 'Add as <u><strong>b</strong></u>arcode to existing product',
|
||||
className: 'btn-info add-new-barcode-dialog-button',
|
||||
callback: function()
|
||||
{
|
||||
window.location.href = '/inventory?addbarcodetoselection=' + encodeURIComponent(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).on('keypress', function(e)
|
||||
{
|
||||
if (e.key === 'B' || e.key === 'b')
|
||||
{
|
||||
$('.add-new-barcode-dialog-button').click();
|
||||
}
|
||||
if (e.key === 'p' || e.key === 'P')
|
||||
{
|
||||
$('.add-new-product-dialog-button').click();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -145,22 +145,32 @@ $(function()
|
||||
callback: function() { }
|
||||
},
|
||||
addnewproduct: {
|
||||
label: 'Add as new product',
|
||||
className: 'btn-success',
|
||||
label: 'Add as new <u><strong>p</strong></u>roduct',
|
||||
className: 'btn-success add-new-product-dialog-button',
|
||||
callback: function()
|
||||
{
|
||||
window.location.href = '/product/new?prefillname=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent(window.location.pathname);
|
||||
}
|
||||
},
|
||||
addbarcode: {
|
||||
label: 'Add as barcode to existing product',
|
||||
className: 'btn-info',
|
||||
label: 'Add as <u><strong>b</strong></u>arcode to existing product',
|
||||
className: 'btn-info add-new-barcode-dialog-button',
|
||||
callback: function()
|
||||
{
|
||||
window.location.href = '/purchase?addbarcodetoselection=' + encodeURIComponent(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).on('keypress', function(e)
|
||||
{
|
||||
if (e.key === 'B' || e.key === 'b')
|
||||
{
|
||||
$('.add-new-barcode-dialog-button').click();
|
||||
}
|
||||
if (e.key === 'p' || e.key === 'P')
|
||||
{
|
||||
$('.add-new-product-dialog-button').click();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user