Sha256: a1eec986edacf86e4a0083adc4f866ea48b872926ce284cd9a1be9bc7d8625bc

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

// 'Polyfill' for :placeholder-shown, since it's not standard yet

$(document).on('focus focusout', '*:not(.zuo-datepicker) > .zuo-textbox', function(e) {
  $("label[for='" + $(this).attr('id') + "']").toggleClass('floating', $(this).val() !== "");
});

$(document).on('change.select2', 'select', function(e) {
  $("label[for='" + $(this).attr('id') + "']").toggleClass('floating', !['', null].includes($(this).val()));
});

$(document).on('change change.select2', '.zuo-form-group.has-error > input, .zuo-form-group.has-error > select', function(e) {
  $(this).parent('.zuo-form-group').removeClass('has-error');
});

$(document).on('show', '.zuo-datepicker', function(e) {
  $(this).children('.zuo-floating-label').addClass('floating');
});

$(document).on('hide', '.zuo-datepicker', function(e) {
  $(this).children('.zuo-floating-label').toggleClass('floating', !!e.date);
});

$.fn.select2.defaults.set("theme", "bootstrap");
$.fn.select2.defaults.set("dropdownAutoWidth", true);
$.fn.select2.defaults.set("width", "100%");
$.fn.select2.defaults.set("placeholder", "");

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zuora_connect_ui-0.8.3 app/assets/javascripts/zuora_connect_ui/input.js
zuora_connect_ui-0.8.2 app/assets/javascripts/zuora_connect_ui/input.js
zuora_connect_ui-0.8.1 app/assets/javascripts/zuora_connect_ui/input.js
zuora_connect_ui-0.8.0 app/assets/javascripts/zuora_connect_ui/input.js
zuora_connect_ui-0.7.1 app/assets/javascripts/zuora_connect_ui/input.js
zuora_connect_ui-0.7.0 app/assets/javascripts/zuora_connect_ui/input.js
zuora_connect_ui-0.6.2 app/assets/javascripts/zuora_connect_ui/input.js
zuora_connect_ui-0.6.1 app/assets/javascripts/zuora_connect_ui/input.js