Automatically scroll plugins into view

This commit is contained in:
Lorenz Hübschle-Schneider 2014-02-10 20:42:19 +00:00 committed by David Cormier
commit e48fe29cf8
2 changed files with 10 additions and 1 deletions

View file

@ -810,6 +810,15 @@ weechat.directive('plugin', function() {
*/
$scope.displayedContent = $scope.plugin.content;
$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);
}
};
}