codeql
Lorenz Hübschle-Schneider 5 years ago
parent 0e13bd68b1
commit 788855d2e3
  1. 14
      js/plugin-directive.js

@ -32,20 +32,20 @@ weechat.directive('plugin', ['$rootScope', 'settings', function($rootScope, sett
$scope.hideContent = function() { $scope.hideContent = function() {
$scope.plugin.visible = false; $scope.plugin.visible = false;
// Pause noise makers // Pause noise makers
var element = $scope.plugin.getElement() var element = $scope.plugin.getElement();
// If it's video we can pause it // If it's video we can pause it
var video = element.querySelector( 'video' ); var video = element.querySelector('video');
if ( video ) { if (video) {
video.pause(); video.pause();
} }
// If it's audio we can pause it // If it's audio we can pause it
var audio = element.querySelector( 'audio' ); var audio = element.querySelector('audio');
if ( audio ) { if (audio) {
audio.pause(); audio.pause();
} }
// If it has an iframe, have to reload it so it would stop // If it has an iframe, have to reload it so it would stop
var iframe = element.querySelector( 'iframe'); var iframe = element.querySelector('iframe');
if ( iframe ) { if (iframe) {
var innerHTML = element.innerHTML; var innerHTML = element.innerHTML;
element.innerHTML = innerHTML; element.innerHTML = innerHTML;
} }

Loading…
Cancel
Save