refactor setFormEditable

This commit is contained in:
snogcel 2016-09-24 18:18:39 -06:00
parent 6f6301da48
commit 9f2deea047

View file

@ -177,22 +177,16 @@
}; };
ProposalGenerator.prototype.resetProposal = function() { ProposalGenerator.prototype.resetProposal = function() {
$('#name').val(''); $('.createProposal input').each(function() {
$('#url').val(''); $(this).val('');
$('#start_epoch').val(''); });
$('#end_epoch').val('');
$('#payment_address').val('');
$('#payment_amount').val('');
setFormEditable(true); setFormEditable(true);
} };
function setFormEditable(edit) { function setFormEditable(edit) {
$('#name').attr("disabled", edit); $('.createProposal input').each(function() {
$('#url').attr("disabled", edit); $(this).attr("disabled", edit);
$('#start_epoch').attr("disabled", edit); });
$('#end_epoch').attr("disabled", edit);
$('#payment_address').attr("disabled", edit);
$('#payment_amount').attr("disabled", edit);
if (edit === true) { if (edit === true) {
$('#btnPrepare').addClass('hidden'); $('#btnPrepare').addClass('hidden');