1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Ensure ctrl+click opens button clicks in a new window

This commit is contained in:
Hillel Coren 2017-10-24 20:58:22 +03:00
parent b34be02030
commit 0be04fa023
7 changed files with 48 additions and 49 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1321,3 +1321,11 @@ function formatXml(xml) {
return formatted; return formatted;
} }
function openUrlOnClick(url, event) {
if (event.ctrlKey) {
window.open(url, '_blank');
} else {
window.location = url;
}
}

View File

@ -309,11 +309,11 @@
var loadedTabs = {}; var loadedTabs = {};
$(function() { $(function() {
$('.normalDropDown:not(.dropdown-toggle)').click(function() { $('.normalDropDown:not(.dropdown-toggle)').click(function(event) {
window.location = '{{ URL::to('clients/' . $client->public_id . '/edit') }}'; openUrlOnClick('{{ URL::to('clients/' . $client->public_id . '/edit') }}', event);
}); });
$('.primaryDropDown:not(.dropdown-toggle)').click(function() { $('.primaryDropDown:not(.dropdown-toggle)').click(function(event) {
window.location = '{{ URL::to('clients/statement/' . $client->public_id ) }}'; openUrlOnClick('{{ URL::to('clients/statement/' . $client->public_id ) }}', event);
}); });
// load datatable data when tab is shown and remember last tab selected // load datatable data when tab is shown and remember last tab selected

View File

@ -595,12 +595,4 @@
</div> </div>
@endif @endif
<script type="text/javascript">
$(function() {
$('.normalDropDown:not(.dropdown-toggle)').click(function() {
window.location = '{{ URL::to('invoices/create') }}';
});
});
</script>
@stop @stop

View File

@ -58,8 +58,8 @@
)->split() !!} )->split() !!}
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
$('.recurringDropdown:not(.dropdown-toggle)').click(function() { $('.recurringDropdown:not(.dropdown-toggle)').click(function(event) {
window.location = '{{ url('/recurring_invoices') }}'; openUrlOnClick('{{ url('/recurring_invoices') }}', event);
}); });
}); });
</script> </script>
@ -78,11 +78,11 @@
)->split() !!} )->split() !!}
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
$('.recurringDropdown:not(.dropdown-toggle)').click(function() { $('.recurringDropdown:not(.dropdown-toggle)').click(function(event) {
window.location = '{{ url('/recurring_expenses') }}'; openUrlOnClick('{{ url('/recurring_expenses') }}', event)
}); });
$('.categoriesDropdown:not(.dropdown-toggle)').click(function() { $('.categoriesDropdown:not(.dropdown-toggle)').click(function(event) {
window.location = '{{ url('/expense_categories') }}'; openUrlOnClick('{{ url('/expense_categories') }}', event);
}); });
}); });
</script> </script>
@ -96,8 +96,8 @@
)->split() !!} )->split() !!}
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
$('.projectsDropdown:not(.dropdown-toggle)').click(function() { $('.projectsDropdown:not(.dropdown-toggle)').click(function(event) {
window.location = '{{ url('projects') }}'; openUrlOnClick('{{ url('/projects') }}', event);
}); });
}); });
</script> </script>

View File

@ -191,15 +191,14 @@
var loadedTabs = {}; var loadedTabs = {};
$(function() { $(function() {
$('.normalDropDown:not(.dropdown-toggle)').click(function() { $('.normalDropDown:not(.dropdown-toggle)').click(function(event) {
window.location = '{{ URL::to('vendors/' . $vendor->public_id . '/edit') }}'; openUrlOnClick('{{ URL::to('vendors/' . $vendor->public_id . '/edit') }}', event)
}); });
$('.primaryDropDown:not(.dropdown-toggle)').click(function() { $('.primaryDropDown:not(.dropdown-toggle)').click(function(event) {
window.location = '{{ URL::to('expenses/create/' . $vendor->public_id ) }}'; openUrlOnClick('{{ URL::to('expenses/create/' . $vendor->public_id ) }}', event);
}); });
$('.nav-tabs a[href="#expenses"]').tab('show'); $('.nav-tabs a[href="#expenses"]').tab('show');
//load_expenses();
}); });
function onArchiveClick() { function onArchiveClick() {