PageSourceSearch

https://joebailey.photography/view/js/brandheader.js?v=573

js joebailey.photography collected 2026-09-29 00:09:41 UTC 2,068 bytes, 66 lines download raw bytes

1"use strict";
2
3var brandheader = {
4
5    init: function () {
6        if ($('.brandheader').length) {
7            base.subscribe('resize', brandheader.resize);
8            $('.brandheader .toggle').bind('click', brandheader.toggle);
9        }
10    },
11
12    resize: function () {
13        //allow title to display below
14        if (!$('.brandheader').parent('div').height()) {
15            var bh = $('.brandheader').height();
16            $('.brandheader').parent('div').height(`${bh}px`);
17        }
18        var hl = $('.brandheader .headerlogo');
19        var ba = $('.brandheader .brandanchor');
20        if (ba.length == 0) { return false; }
21        var lp = ba.offset().left;
22        var baw = ba.outerWidth(true) + ba.offset().left;
23        var nv = $('.brandheader .nav');
24        var nd = $('.brandheader .nav-drop');
25        var mw = $(window).width() - (lp * 2);
26        if (nv.length > 0) {
27            nv.css({ opacity: 0 }).show();
28            if (nv.offset().left > (baw + 10)) {
29                nv.css({ opacity: 1 });
30                nd.hide().removeClass('open');
31            }
32            else {
33                nv.hide();
34                nd.show();
35                mw = nd.offset().left - (lp * 1.5);
36            }
37        }
38        if (hl.length) {
39            if (hl.width() == 0) {
40                window.setTimeout(function () { brandheader.resize(); }, 50);
41                return false;
42            }
43            var iw = (hl[0].iwidth) ? hl[0].iwidth : (hl[0].iwidth = hl.width());
44            var ih = (hl[0].iheight) ? hl[0].iheight : (hl[0].iheight = hl.height());
45            var sc = (mw / iw);
46            if (sc < 1) {
47                hl.css({ width: (iw * sc), height: (ih * sc) });
48            }
49            else {
50                hl.css({ width: iw, height: ih });
51            }
52        }
53    },
54
55    toggle: function () {
56        var nd = $('.brandheader .nav-drop');
57        if (nd.hasClass('open')) {
58            nd.removeClass('open');
59        }
60        else {
61            nd.addClass('open');
62        }
63    }
64};
65
66$(brandheader.init);

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.