Sha256: 1876b6a675db618af3574eb553d7a299215bfee0a888d205f4d73ca8be5aa6ff

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 Bytes

Contents

window.materializeForm = {
  init: function() {
    this.initSelect()
    this.initCheckbox()
    this.initDate()  
  },
  initSelect: function() {
    $('select[multiple="multiple"] option[value=""]').attr('disabled', true)
    $('select').material_select()
  },
  initCheckbox: function() {
    $('input[type=checkbox]').addClass('filled-in')
  },
  initDate: function() {
    $('input.date').pickadate({
      selectMonths: true, 
      selectYears: 100
    });
  }
}

$(document).ready(function() {
  window.materializeForm.init()
});

$(document).ajaxSuccess(function() {
  window.materializeForm.init()
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
materialize-form-1.0.6 app/assets/javascripts/materialize-form.js
materialize-form-1.0.5 app/assets/javascripts/materialize-form.js
materialize-form-1.0.4 app/assets/javascripts/materialize-form.js