Sha256: 9e4c1fddc9fb6a4f5af1fc2c54c3a5ecd54010827f2089f77d856261c9c9234a

Contents?: true

Size: 1.24 KB

Versions: 2

Compression:

Stored size: 1.24 KB

Contents

$(function(){
  
  // $('input:enabled:visible:first').focus().next(".ui-input-hint").hide();
  
  $(".ui-button").each(function(){
    $(this).button({
      icons: {
        primary: $(this).attr("data-icon")
      }
    });
  });
  $(".ui-radio-input fieldset.to-buttonset").buttonset();
  $(".ui-check_boxes-input fieldset.to-buttonset").buttonset();
  $("input[type='date'].ui-date-input, input[type='text'].ui-date-input" ).each(function(){
    var options = {};
    if($(this).attr('data-calendar') != "") {
      options = $.parseJSON($(this).attr('data-calendar'));
    }
    $(this).datepicker(options);
  });
  
  $('input, textarea').live("focus", function(){
    if ($(this).attr("type") == "checkbox" || $(this).attr("type") == "radio") {
      return;
    }
    $(this).next(".ui-input-hint").hide();
  });
  $('input, textarea').live("blur", function(){
    if ($(this).val().length == 0){
      $(this).next(".ui-input-hint").show();
    }
  });
  jquery_ui_form_events();
});

function jquery_ui_form_events() {
  
  $('input, textarea').each(function(){
    if ($(this).attr("type") == "checkbox" || $(this).attr("type") == "radio") {
      return;
    }
    if ($(this).val().length > 0){
      $(this).next(".ui-input-hint").hide();
    }
  });
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jquery-ui-form-0.1.2 lib/generators/templates/jquery-ui-form.js
jquery-ui-form-0.1.1 lib/generators/templates/jquery-ui-form.js