Skip to content
Snippets Groups Projects
Verified Commit aeec9d36 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Add edit_mode listener to qrcode.js

parent 11786517
No related branches found
No related tags found
2 merge requests!47Release v0.4.0,!43qrcode
Pipeline #14280 passed
......@@ -163,16 +163,23 @@ var ext_qrcode = function ($, connection, getEntityVersion, getEntityID, QRCode,
$(entity).find(`.${_buttons_list_class} .${_qrcode_button_class}`).remove();
}
var _init = function () {
for (let entity of $(".caosdb-entity-panel")) {
remove_qrcode_button(entity);
add_qrcode_to_entity(entity);
}
}
/**
* Initialize this module and append a QR Code button to all entities panels on the page.
*
* Removes all respective buttons if present before adding a new one.
*/
var init = function () {
for (let entity of $(".caosdb-entity-panel")) {
remove_qrcode_button(entity);
add_qrcode_to_entity(entity);
}
_init();
// edit-mode-listener
document.body.addEventListener(edit_mode.end_edit.type, _init, true);
};
return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment