Skip to content

Commit

Permalink
Eq removal with parser informed.. another fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharp38 committed Nov 10, 2023
1 parent fff1e5f commit c20985a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 22 additions & 0 deletions desktop/js/Abeille.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,28 @@ function removeSelectedEq(zgId) {
for (const eqId of eqIdList) removeEq(zgId, eqId);
}

/* Click on 'remove' button in equipement details page.
Delete current equipment from Jeedom DB.
Default action from 'core/js/plugin.template.js' is redefined */
$(".eqLogicAction[data-action=remove]")
.off("click")
.on("click", function (evt) {
console.log("eqLogicAction[data-action=remove] click: evt=", evt);
evt.stopPropagation();

if ($(".eqLogicAttr[data-l1key=id]").value() == undefined) {
console.log("ERROR: Undefined 'data-l1key=id'");
return;
}
eqId = $(".eqLogicAttr[data-l1key=id]").value();
eqLogicalId = $(".eqLogicAttr[data-l1key=logicalId]").value();
zgId = eqLogicalId.substring(7, 8);
console.log(
"eqId=" + eqId + ", logicId=" + eqLogicalId + " => zgId=" + zgId
);
removeEq(zgId, eqId);
});

/* Remove from Jeedom eq with ID 'eqId' but list first how it is used and ask confirmation to user */
function removeEq(zgId, eqId) {
console.log("removeEq(" + eqId + ")");
Expand Down
1 change: 0 additions & 1 deletion desktop/php/Abeille.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
</div>

<!-- Scripts -->
<!-- < ?php include 'Abeille-Js.php'; ?> -->
<?php include_file('desktop', 'Abeille', 'js', 'Abeille'); ?>
<script>
// TODO: addCmdToTable() to be moved to Abeille.js but need to fix remaining PHP code in it.
Expand Down

0 comments on commit c20985a

Please sign in to comment.