PageSourceSearch

https://yuktix.com/assets/helpers/hs.focus-state.js

js yuktix.com collected 2026-10-01 11:45:32 UTC 836 bytes, 37 lines download raw bytes

1/**
2 * Focus state helper-wrapper.
3 *
4 * @author Htmlstream
5 * @version 1.0
6 *
7 */
8;(function ($) {
9  'use strict';
10
11  $.HSCore.helpers.HSFocusState = {
12    /**
13     * Focus state.
14     *
15     * @return undefined
16     */
17    init: function () {
18      var collection = $('.js-focus-state input:not([type="checkbox"], [type="radio"]), .js-focus-state textarea, .js-focus-state select');
19
20      if (!collection.length) return;
21
22      collection.on('focusin', function () {
23        var $this = $(this),
24            $thisParent = $this.closest('.js-focus-state');
25
26        $thisParent.addClass('u-focus-state');
27      });
28
29      collection.on('focusout', function () {
30        var $this = $(this),
31            $thisParent = $this.closest('.js-focus-state');
32
33        $thisParent.removeClass('u-focus-state');
34      });
35    }
36  };
37})(jQuery);

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.