Skip to main content

Town of Amherst, Inspection Services, Residential Rental Property Registration & Inspection Program

Citation
Town of Amherst, Inspection Services, Residential Rental Property Registration & Inspection Program
Jurisdiction
Amherst (municipal)
Source
Official source

Related Parts of This Source

Full Text

1,742 chars
function iterateLeftpads(cb) {
const containersTS = $("[class^='siteWrap'],[class*=' siteWrap']");
for (let i = 0; i < containersTS.length; i++) {
const containerTS = containersTS[i];
// Skip the body container and anything with data-skip-leftpad
if (
containerTS.id !== "bodyContainerTS" &&
containerTS.getAttribute('data-skip-leftpad') === null
) {
cb(containerTS);
}
}
}

const anchor = $("#divToolbars");

// Outer banner padding (push banner down)
const outerSizingTS = $("#bannerContainerTS");
// Inner banner padding (push banner content down) - Transparent header OR on attaching headers
const innerSizingTS = $("#bannerSizingTS");
const bodyContainerTS = $("#bodyContainerTS");

const forceUnfixClassTS = "forceUnfixTS";

const fixedTopTS = $(".fixedTopTS");
const fixedBottomTS = $(".fixedBottomTS");
const fixedLeftTS = $(".fixedLeftTS");

var initialTopTS;
var topAttachTS;
if (fixedTopTS && fixedTopTS.length === 1) {
initialTopTS = getValueTS(fixedTopTS, 'top');
const attachment = fixedTopTS.attr('data-attach');
if (attachment) topAttachTS = $("#" + attachment);
if (!topAttachTS || topAttachTS.length !== 1) topAttachTS = undefined;
}

function resizeAdjustmentTS() {
const editing = isPageEditingTS();

// Fixed top script
(function () {
if (!fixedTopTS || fixedTopTS.length !== 1 || initialTopTS === undefined) return;

if (editing) {
fixedTopTS[0].classList.add(forceUnfixClassTS);
} else {
fixedTopTS[0].classList.remove(forceUnfixClassTS);
}

const topPosition = fixedTopTS.css('position');
if (topPosition === 'fixed') {
if (topAttachTS) {
scrollAdjustmentTS();
} else {
const anchorHeight = anchor.outerHeight() - 1;
fixedTopTS.css('top', anchorHeight + initialTopTS);
}
} else {
fixedTopTS.css('top', initialTopTS);
}