Skip to content

Commit

Permalink
disable button on submit. closes #270
Browse files Browse the repository at this point in the history
  • Loading branch information
cyriltata committed Nov 30, 2016
1 parent 824fb9b commit 31f20b0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions application/Model/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,12 @@ protected function setMoreOptions() {
$this->classes_wrapper[] = 'btn-check';
}

protected function render_label() {
return '<label class="' . implode(" ", $this->classes_label) . '">' .
($this->error ? '<span class="label label-danger hastooltip" title="' . $this->error . '"><i class="fa fa-exclamation-triangle"></i></span> ' : '') . $this->label_parsed .
'</label>';
}

protected function render_appended() {
$ret = '<div class="btn-group js_shown">
<button type="button" class="btn" data-for="item' . $this->id . '_1"><i class="fa fa-2x fa-fw"></i></button>' .
Expand Down
4 changes: 4 additions & 0 deletions webroot/assets/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ div.all-alerts + div
color: #5BC0DE;
text-shadow: none;
}
.btn-info[disabled] {
background-color: transparent !important;
border: #ffffff solid 1px;
}
.btn-info:hover,.btn-info:active,.btn-info:focus {
background-color: #DCF7FB;
color: #5BC0DE;
Expand Down
4 changes: 3 additions & 1 deletion webroot/assets/js/survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
this.last_update = false;
this.next_update = false;
this.dont_update = false;
this.spinner = '<i class="fa fa-spinner fa-spin"></i>';
this.spinner = ' <i class="fa fa-spinner fa-spin"></i>';
var survey = this;
// initialising special items
// --------------------------
Expand Down Expand Up @@ -377,12 +377,14 @@
}
if ($form.checkValidity()) {
$button.append(survey.spinner);
$button.prop('disabled', true);
return true;
} else {
return false;
}
});
}

Survey.prototype.update = function () {
var survey = this;
if (survey.dont_update) {
Expand Down

0 comments on commit 31f20b0

Please sign in to comment.