Skip to content

Commit

Permalink
better masking for cross browser compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinW520 committed Feb 2, 2019
1 parent c695b57 commit 6cab698
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/assets/javascripts/theme.js
Expand Up @@ -53,7 +53,8 @@ $(window).on('load resize', function() {
$(document).ready(function() {

// Plugins init
$("input[type='tel']").mask('(000) 000-0000')
$("input.date.masked-date").mask('00/00/0000', { placeholder: "MM/DD/YYYY" })
$("input[type='tel']").mask('(000) 000-0000', { placeholder: "(111) 222-3333"})
$(".scrollbar-inner")[0] && $(".scrollbar-inner").scrollbar().scrollLock();
$('[data-stick-in-parent="true"]')[0] && $('[data-stick-in-parent="true"]').stick_in_parent();
$('.selectpicker')[0] && $('.selectpicker').selectpicker();
Expand Down
1 change: 1 addition & 0 deletions app/models/event.rb
Expand Up @@ -16,6 +16,7 @@ def should_generate_new_friendly_id?
has_many_attached :promo_photos

validates :name, presence: true
validates :short_description, presence: true
validates :starts_at, presence: true

scope :is_active, -> { where(is_active: true) }
Expand Down
2 changes: 1 addition & 1 deletion app/views/participants/_fields.html.haml
Expand Up @@ -11,7 +11,7 @@
.form-group
= f.input :last_name, label: "Your Last Name"
.form-group
= f.input :birth_date, as: :date, html5: true, label: "Your Birthdate"
= f.input :birth_date, as: :date, html5: true, label: "Your Birthdate", placeholder: "mm/dd/yyyy", input_html: { class: "masked-date" }
.form-group
= f.input :division,
as: :radio_buttons,
Expand Down
1 change: 1 addition & 0 deletions config/initializers/simple_form_bootstrap.rb
Expand Up @@ -14,6 +14,7 @@

# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.browser_validations = true
# Default class for buttons
config.button_class = 'btn'

Expand Down

0 comments on commit 6cab698

Please sign in to comment.