unpopup the svg ploygon in zones

pull/3054/head
Andrew Bauer 2020-09-25 12:34:04 -05:00
parent ae9139b00c
commit c73dbc480f
2 changed files with 21 additions and 7 deletions

View File

@ -175,6 +175,22 @@ window.addEventListener("DOMContentLoaded", function onSkinDCL() {
});
});
document.querySelectorAll(".zmlink").forEach(function(el) {
el.addEventListener("click", function onClick(evt) {
var el = this;
var url;
if ( el.hasAttribute("href") ) {
// <a>
url = el.getAttribute("href");
} else {
// buttons
url = el.getAttribute("data-url");
}
evt.preventDefault();
window.location.assign(url);
});
});
document.querySelectorAll(".pillList a").forEach(function addOnClick(el) {
el.addEventListener("click", submitTab);
});

View File

@ -73,13 +73,11 @@ xhtmlHeaders(__FILE__, translate('Zones'));
<?php
foreach( array_reverse($zones) as $zone ) {
?>
<polygon points="<?php echo $zone['AreaCoords'] ?>" class="popup-link <?php echo $zone['Type']?>" data-on-click-true="streamCmdQuit"
data-url="?view=zone&amp;mid=<?php echo $mid ?>&amp;zid=<?php echo $zone['Id'] ?>"
data-window-name="zmZone<?php echo $zone['Id'] ?>"
data-window-tag="zone"
data-window-width="<?php echo $monitor->ViewWidth() ?>"
data-window-height="<?php echo $monitor->ViewHeight() ?>"
/>
<polygon points="<?php echo $zone['AreaCoords'] ?>"
class="zmlink <?php echo $zone['Type']?>"
data-on-click-true="streamCmdQuit"
data-url="?view=zone&amp;mid=<?php echo $mid ?>&amp;zid=<?php echo $zone['Id'] ?>"
/>
<?php
} // end foreach zone
?>