embedded content: check if scrollIntoViewIfNeeded vendor method is available

This commit is contained in:
Ailin Nemui 2014-08-27 10:53:57 +02:00
parent 2163b930f6
commit 5e9fd27c89

View file

@ -41,7 +41,7 @@ weechat.directive('plugin', ['$rootScope', function($rootScope) {
// Scroll embed content into view
var scroll = function() {
var embed = document.querySelector(".embed_" + $scope.plugin.$$hashKey);
if (embed) {
if (embed && embed.scrollIntoViewIfNeeded !== undefined) {
embed.scrollIntoViewIfNeeded();
}
};