Skip to main content

Town of Arlington, Town Bylaws, Title V, Article 18 (Short Term Rentals)

Citation
Town of Arlington, Town Bylaws, Title V, Article 18 (Short Term Rentals)
Jurisdiction
Arlington (municipal)
Source
Official source

Related Parts of This Source

Full Text

1,594 chars
var shareContainerTimeout = null;
$("#" + widgetContext + " #share").bind('mouseover', function () {
//If not relate to click event
if (shareContainerTimeout) {
clearTimeout(shareContainerTimeout);
shareContainerTimeout = null;
}
shareContainerTimeout = setTimeout(function () {
if (!$shareContainer.hasClass("click-active")) {
openShareMenu(false);
}
}, 100);
});

$("#" + widgetContext + " #share").bind('mouseleave', function () {
//If not relate to click event
if (shareContainerTimeout) {
clearTimeout(shareContainerTimeout);
shareContainerTimeout = null;
}
shareContainerTimeout = setTimeout(function () {
if (!$shareContainer.hasClass("click-active")) {
closeShareMenu(false);
}
}, 200);
});

$shareContainer.on("keydown", function (e) {
if (e.key === "Escape" || e.key === "Esc" || e.keyCode === 27) {
if ($shareMenu.is(":visible")) {
e.preventDefault();
e.stopPropagation();
closeShareMenu(true);
}
}
});

$shareTrigger.on("keydown", function (e) {
if (e.key === " " || e.keyCode === 32) {
e.preventDefault();
if ($shareContainer.hasClass("click-active")) {
closeShareMenu(false);
} else {
openShareMenu(true);
}
}
});

$shareContainer.on("focusout", function (e) {
if (!$shareMenu.is(":visible")) {
return;
}

var relatedTarget = e.relatedTarget;
if (relatedTarget && ($shareContainer.is(relatedTarget) || $shareContainer.has(relatedTarget).length > 0)) {
return;
}

setTimeout(function () {
var activeElement = document.activeElement;
if (!activeElement || (!$shareContainer.is(activeElement) && $shareContainer.has(activeElement).length === 0)) {
closeShareMenu(false);
}
}, 0);
});