added disabled state to submit when no model is selected
This commit is contained in:
parent
58840ba128
commit
ea3bbc4ebd
3 changed files with 17 additions and 2 deletions
|
@ -10,7 +10,7 @@
|
|||
h3 { text-align:center; padding-bottom:0.8em; }
|
||||
#modal-trigger { display:block; margin:1em auto; }
|
||||
|
||||
|
||||
#help { font-size:13px; margin-left:15px; opacity:0.7 }
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
$modifier = $('#modifier input'),
|
||||
$minified = $('#minified input'),
|
||||
$submit = $('#submit');
|
||||
$help = $('#help');
|
||||
|
||||
// bind event handlers
|
||||
$options.click( _handleSelect );
|
||||
|
@ -26,6 +27,7 @@
|
|||
e.preventDefault();
|
||||
_setSelectedModel(this);
|
||||
_setSelectLabel(model.name);
|
||||
_enableSubmit();
|
||||
}
|
||||
|
||||
function _handleSubmit(e) {
|
||||
|
@ -54,6 +56,16 @@
|
|||
$submit.button('reset');
|
||||
}
|
||||
|
||||
function _disableSubmit() {
|
||||
$submit.attr('disabled', 'disabled');
|
||||
// $help.fadeIn(100);
|
||||
}
|
||||
|
||||
function _enableSubmit() {
|
||||
$submit.removeAttr('disabled');
|
||||
// $help.fadeOut(100);
|
||||
}
|
||||
|
||||
function _setSelectedModel(option) {
|
||||
var $option = $(option);
|
||||
model = {
|
||||
|
|
|
@ -18,7 +18,10 @@ block content
|
|||
label#minified.checkbox
|
||||
input(type='checkbox', checked)
|
||||
| Minified output
|
||||
button#submit.btn.btn-primary.btn-large(data-loading-text='Fetching specs...') Get Specs
|
||||
button#submit.btn.btn-primary.btn-large(disabled, data-loading-text='Fetching specs...') Get Specs
|
||||
//- span#help.help-inline
|
||||
//- i.icon-exclamation-sign
|
||||
//- | Select a model first!
|
||||
div#results.row-fluid
|
||||
div.span4
|
||||
h3 Model Name
|
||||
|
|
Loading…
Reference in a new issue