Buttons Added

This commit is contained in:
rawee
2023-02-12 01:23:18 +05:30
parent f0221c4c70
commit 2823eb349d
9 changed files with 610 additions and 333 deletions

View File

@@ -24,15 +24,10 @@
}
};
var adminNodeId = null;
RED.comms.subscribe("whatsappLinkNodeID", function (e, currentID) {
adminNodeId = currentID;
})
var creatImageContainer = function(NodeID) {
let img = document.getElementById("whatsappLink-QRcode-" + NodeID)
if (!img) {
const container = document.getElementById(adminNodeId)
const container = document.getElementById(NodeID)
if (!container) { return }
const img = document.createElementNS("http://www.w3.org/2000/svg", 'image')
img.setAttribute('id', "whatsappLink-QRcode-" + NodeID)
@@ -50,9 +45,10 @@
qrImage.addEventListener("click", ()=> removeQrCode(id), {once:true})
};
RED.comms.subscribe("whatsappLinkQrCode", function (e, msg) {
if (msg.image === null){
removeQrCode(msg.id);
removeQrCode(adminNodeId);
}
renderQrCode(msg.id, msg.image);
});