* attach encrypt frame to element * @param {Array} elements
(elements)
| 330 | * @param {Array} elements |
| 331 | */ |
| 332 | function attachEncryptFrame(elements) { |
| 333 | // filter out attached and detached frames |
| 334 | elements = elements.filter(element => !isAttached(element)); |
| 335 | // create new encrypt frames for new discovered editable fields |
| 336 | elements.forEach(element => { |
| 337 | const eFrame = new EncryptFrame(); |
| 338 | eFrame.attachTo(element); |
| 339 | }); |
| 340 | } |
| 341 | |
| 342 | export function isAttached(element) { |
| 343 | if (!element) { |
no test coverage detected