1/** 2 * @file 3 * Extends methods from core/misc/form.js. 4 */ 5 6(function ($, window, Drupal, drupalSettings, once) { 7 8 /** 9 * Behavior for "forms_has_error_value_toggle" theme setting. 10 */ 11 Drupal.behaviors.bootstrapForm = { 12 attach: function (context) { 13 if (drupalSettings.bootstrap && drupalSettings.bootstrap.forms_has_error_value_toggle) { 14 var $context = $(context); 15 $(once('error', '.form-item.has-error:not(.form-type-password.has-feedback)', context)).each(function () { 16 var $formItem = $(this); 17 var $input = $formItem.find(':input'); 18 $input.on('keyup focus blur', function () { 19 if (this.defaultValue !== void 0) { 20 $formItem[this.defaultValue !== this.value ? 'removeClass' : 'addClass']('has-error'); 21 $input[this.defaultValue !== this.value ? 'removeClass' : 'addClass']('error'); 22 } 23 }); 24 }); 25 } 26 } 27 }; 28 29 30})(jQuery, this, Drupal, drupalSettings, once);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.