From 2e963da5811bbc6b680e70fb75f343f64502b60e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Thu, 13 Feb 2014 20:46:18 +0000 Subject: [PATCH] Don't use jQuery, simplify --- js/glowingbear.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 3a4e49c..8e3ff25 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -812,13 +812,11 @@ weechat.directive('plugin', function() { $scope.plugin.visible = true; // Scroll embed content into view - var elems = $("." + $scope.plugin.$$hashKey); - if (elems.length == 1) { - var scroll = function() { - elems[0].scrollIntoViewIfNeeded(); - }; - setTimeout(scroll, 100); - } + var scroll = function() { + var embed = document.querySelector("." + $scope.plugin.$$hashKey); + embed.scrollIntoViewIfNeeded(); + }; + setTimeout(scroll, 100); }; }