workaround preventing mentions view scrolling down to first youtube video

This commit is contained in:
Jeena Paradies 2013-02-27 22:11:26 +01:00
parent f049a5d521
commit 16b6ed788a

View file

@ -932,7 +932,18 @@ function(jQuery, Paths, URI, HostApp, Cache) {
}
Core.prototype.addYouTube = function(id, images) {
$(images).append('<iframe class="youtube" type="text/html" width="100%" height="200" src="http://www.youtube.com/embed/' + id + '?rel=0&showsearch=0&version=3&modestbranding=1" frameborder="0" webkitAllowFullScreen allowFullScreen />')
var iframe = $('<iframe class="youtube" type="text/html" width="100%" height="200" frameborder="0" webkitAllowFullScreen allowFullScreen />')
iframe.appendTo(images);
// This is a workaround without it it in the Mentions view it scrolls
// down to the first video on load.
iframe.load(function() {
iframe.contents().find('*').each(function () {
$(this).removeAttr("tabindex");
});
})
iframe.attr("src", 'http://www.youtube.com/embed/' + id + '?rel=0&showsearch=0&version=3&modestbranding=1');
}
Core.prototype.addVimeo = function(id, images) {