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,718 chars
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);
}

if (topPosition === 'fixed' || topPosition === 'absolute') {
// Bump the banner content down
if (isTransparentTS(fixedTopTS)) {
innerSizingTS.css('padding-top', initialTopTS + fixedTopTS.outerHeight() - 1);
outerSizingTS.css('padding-top', '');

try {
window.Pages.onResizeHandlersExecute();
} catch (e) { }
} else {
outerSizingTS.css('padding-top', fixedTopTS.outerHeight() - 1);
innerSizingTS.css('padding-top', '');
}
} else {
innerSizingTS.css('padding-top', '');
outerSizingTS.css('padding-top', '');
}
})();

// Fixed bottom script
(function () {
if (!fixedBottomTS || fixedBottomTS.length === 0) return;

// If the widget has gone narrow, force unfix
if (editing || fixedBottomTS.outerHeight() > 200) {
fixedBottomTS[0].classList.add(forceUnfixClassTS);
} else {
fixedBottomTS[0].classList.remove(forceUnfixClassTS);
}