1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Disable import button once it's clicked

This commit is contained in:
Hillel Coren 2017-03-27 13:17:09 +03:00
parent 543e6c598a
commit 344fc06315
5 changed files with 14 additions and 8 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

@ -203,6 +203,11 @@ padding: 5px 10px;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-info:disabled {
background-color: #e89259 !important;
border-color: #e89259 !important;
}
/*
.xbtn-primary {
background-color: #34495E;

View File

@ -23,6 +23,7 @@
<div class="panel-body">
{!! Former::open_for_files('/import')
->onsubmit('return onFormSubmit(event)')
->addClass('warn-on-exit') !!}
{!! Former::select('source')
@ -50,7 +51,7 @@
</div>
<br/>
{!! Former::actions( Button::info(trans('texts.upload'))->submit()->large()->appendIcon(Icon::create('open'))) !!}
{!! Former::actions( Button::info(trans('texts.upload'))->withAttributes(['id' => 'uploadButton'])->submit()->large()->appendIcon(Icon::create('open'))) !!}
{!! Former::close() !!}
</div>
@ -117,6 +118,11 @@
setCheckboxesEnabled();
});
function onFormSubmit() {
$('#uploadButton').attr('disabled', true);
return true;
}
function setCheckboxesEnabled() {
var $checkboxes = $('.entity-types input[type=checkbox]');
var include = $('input[name=include]:checked').val()

View File

@ -20,11 +20,6 @@
float: left;
}
.btn-info:disabled {
background-color: #e89259 !important;
border-color: #e89259 !important;
}
#scrollable-dropdown-menu .tt-menu {
max-height: 150px;
overflow-y: auto;