Skip to content

Commit

Permalink
Automatically disable the button after pressing it (fastlane#161)
Browse files Browse the repository at this point in the history
* Automatically disable the button after pressing it

Due to longer waiting times sometimes

* Update code to use `onsubmit` instead of `onclick` to remove setTimeout
  • Loading branch information
KrauseFx authored May 24, 2017
1 parent 61212ac commit f70241f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/views/invite/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<% unless @message %>
<h4 class="" style="margin-bottom: 40px;"><%= @metadata[:title] %></h4>

<%= form_tag("submit", method: "post", style: "text-align: left") do %>
<%= form_tag("submit", method: "post", style: "text-align: left", onsubmit: "didSubmit()") do %>
<%= label_tag(:first_name, t(:first_name_label)) %>
<%= text_field_tag :first_name, '', class: "form-control", placeholder: t(:first_name_placeholder) %><br />
<%= label_tag(:last_name, t(:last_name_label)) %>
Expand Down Expand Up @@ -55,6 +55,13 @@
</p>
</div>

<script type="text/javascript">
function didSubmit() {
$("#submit").val("<%= t(:loading) %>...")
$("#submit").prop('disabled', true)
}
</script>

<style type="text/css">
.appIcon {
-webkit-border-radius: 22.544%;
Expand Down
1 change: 1 addition & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ de:
message_success_pending: "Sie wurden erfolgreich als Tester hinzugefügt. Sie werden benachrichtigt sobald eine neue Version verfügbar ist"
message_email_exists: "E-Mail-Adresse ist bereits registriert"
message_error: "Ein Fehler ist aufgetreten, bitte kontaktieren Sie den Hersteller der Applikation"
loading: "Lade"
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ en:
message_success_pending: "Successfully added you as a tester. You'll be notified once the next build is available"
message_email_exists: "Email address is already registered"
message_error: "Something went wrong, please contact the application owner"
loading: "Loading"

0 comments on commit f70241f

Please sign in to comment.