From: Damyan Ivanov Date: Mon, 19 Jun 2017 12:32:55 +0000 (+0000) Subject: always close the pop-up when tab is re-loaded/opened X-Git-Tag: 2.0~21 X-Git-Url: https://git.ktnx.net/?p=icedeb.git;a=commitdiff_plain;h=35a72bd219624257632d7bfafb586ba9b32d067f;hp=f58a4234607ccc574ea15773b26c7fec6eb259d7 always close the pop-up when tab is re-loaded/opened otherwise JS has no access to the tab, since pop-up's context is no longer related to user action --- diff --git a/icedeb.js b/icedeb.js index c36044c..30f4c3e 100644 --- a/icedeb.js +++ b/icedeb.js @@ -116,15 +116,12 @@ function link_clicked(e) { return false; } - if ( !e.target.classList.contains('icedeb-button') ) - return; - - let autoclose = true; - let clip_input = document.getElementById("clipboard"); + if(clip_input.value == '') + get_clipboard_contents(); let clip = trim(clip_input.value); - console.log(clip); + if(clip_input.value == '') return; let url;