embedded content: check if scrollIntoViewIfNeeded vendor method is available

rewrite-with-urlplugin
Ailin Nemui 11 years ago
parent 2163b930f6
commit 5e9fd27c89
  1. 2
      js/plugin-directive.js

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

Loading…
Cancel
Save