| 1 |
/* Job Listing — frontend */ |
| 2 |
(function () { |
| 3 |
'use strict'; |
| 4 |
|
| 5 |
function init() { |
| 6 |
document.querySelectorAll('.bkjl-wrap').forEach(function (wrap) { |
| 7 |
if (wrap._bkjlInit) { return; } |
| 8 |
wrap._bkjlInit = true; |
| 9 |
|
| 10 |
/* Secondary button hover — mirror primary button colour */ |
| 11 |
var applyBtn = wrap.querySelector('.bkjl-btn-apply'); |
| 12 |
var secBtn = wrap.querySelector('.bkjl-btn-secondary'); |
| 13 |
|
| 14 |
if (applyBtn && secBtn) { |
| 15 |
var primaryBg = applyBtn.style.background || applyBtn.style.backgroundColor || '#6c3fb5'; |
| 16 |
var primaryText = applyBtn.style.color || '#ffffff'; |
| 17 |
|
| 18 |
var origBg = secBtn.style.background || secBtn.style.backgroundColor || ''; |
| 19 |
var origColor = secBtn.style.color || ''; |
| 20 |
|
| 21 |
secBtn.addEventListener('mouseenter', function () { |
| 22 |
secBtn.style.background = primaryBg; |
| 23 |
secBtn.style.color = primaryText; |
| 24 |
}); |
| 25 |
|
| 26 |
secBtn.addEventListener('mouseleave', function () { |
| 27 |
secBtn.style.background = origBg; |
| 28 |
secBtn.style.color = origColor; |
| 29 |
}); |
| 30 |
} |
| 31 |
}); |
| 32 |
} |
| 33 |
|
| 34 |
if (document.readyState === 'loading') { |
| 35 |
document.addEventListener('DOMContentLoaded', init); |
| 36 |
} else { |
| 37 |
init(); |
| 38 |
} |
| 39 |
}()); |
| 40 |
|