Permalink
Browse files

use the menu item instead of body

use the menu item target instead of the document.body to avoid unwanted scrolling on .focus()
  • Loading branch information...
jeffbryner committed Jun 4, 2018
1 parent 46b9e50 commit 49b40bf01e49c40458960c670b3bf08ba02920af
Showing with 3 additions and 3 deletions.
  1. +3 −3 meteor/app/client/layout.js
@@ -12,7 +12,7 @@ if (Meteor.isClient) {
var ipText=$(e.target).attr('data-ipaddress')
var ipTextArea = document.createElement("textarea");
ipTextArea.value = ipText;
document.body.appendChild(ipTextArea);
e.target.appendChild(ipTextArea);
ipTextArea.focus();
ipTextArea.select();
try {
@@ -22,7 +22,7 @@ if (Meteor.isClient) {
} catch (err) {
Session.set('errorMessage','copy failed & ' + JSON.stringify(err));
}
document.body.removeChild(ipTextArea);
e.target.removeChild(ipTextArea);
},
"click .ipmenu-whois": function(e,t){
Session.set('ipwhoisipaddress',($(e.target).attr('data-ipaddress')));
@@ -45,4 +45,4 @@ if (Meteor.isClient) {
$('ul:first',$(e.target)).css('visibility', 'visible');
}
});
}
}

0 comments on commit 49b40bf

Please sign in to comment.