]> git.ktnx.net Git - icedeb.git/commitdiff
always close the pop-up when tab is re-loaded/opened
authorDamyan Ivanov <dmn@debian.org>
Mon, 19 Jun 2017 12:32:55 +0000 (12:32 +0000)
committerDamyan Ivanov <dmn@debian.org>
Mon, 19 Jun 2017 12:32:55 +0000 (12:32 +0000)
otherwise JS has no access to the tab, since pop-up's context is
no longer related to user action

icedeb.js

index c36044c7c6d3a4d75c29cb3cc37f218aaa25f21e..30f4c3e4739aa495de1e6cb53e7a97c1b1f93bf5 100644 (file)
--- 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;