setup controls in clones properly
This commit is contained in:
parent
a9ea92a8bc
commit
4779bd1c17
@ -26,7 +26,7 @@ ImageExpand =
|
|||||||
ImageExpand.expand @
|
ImageExpand.expand @
|
||||||
else if @file.isExpanded and @file.isVideo
|
else if @file.isExpanded and @file.isVideo
|
||||||
ImageExpand.setupVideoCB @
|
ImageExpand.setupVideoCB @
|
||||||
ImageExpand.play @ if !@origin.file.fullImage?.paused or @origin.file.wasPlaying
|
ImageExpand.setupVideo @, !@origin.file.fullImage?.paused or @origin.file.wasPlaying, @origin.file.controls
|
||||||
else if ImageExpand.on and !@isHidden and
|
else if ImageExpand.on and !@isHidden and
|
||||||
(Conf['Expand spoilers'] or !@file.isSpoiler) and
|
(Conf['Expand spoilers'] or !@file.isSpoiler) and
|
||||||
(Conf['Expand videos'] or !@file.isVideo)
|
(Conf['Expand videos'] or !@file.isVideo)
|
||||||
@ -202,16 +202,19 @@ ImageExpand =
|
|||||||
window.scrollBy 0, Math.min(-imageBottom, Header.getTopOf file.fullImage)
|
window.scrollBy 0, Math.min(-imageBottom, Header.getTopOf file.fullImage)
|
||||||
|
|
||||||
if file.isVideo
|
if file.isVideo
|
||||||
ImageExpand.play post if Conf['Autoplay']
|
ImageExpand.setupVideo post, Conf['Autoplay'], Conf['Show Controls']
|
||||||
ImageCommon.addControls file.fullImage if Conf['Show Controls']
|
|
||||||
|
|
||||||
play: (post) ->
|
setupVideo: (post, playing, controls) ->
|
||||||
{fullImage} = post.file
|
{fullImage} = post.file
|
||||||
$.asap (=> doc.contains fullImage), =>
|
fullImage.controls = false
|
||||||
if !d.hidden and Header.isNodeVisible fullImage
|
if playing
|
||||||
fullImage.play()
|
$.asap (=> doc.contains fullImage), =>
|
||||||
else
|
if !d.hidden and Header.isNodeVisible fullImage
|
||||||
post.file.wasPlaying = true
|
fullImage.play()
|
||||||
|
else
|
||||||
|
post.file.wasPlaying = true
|
||||||
|
if controls
|
||||||
|
ImageCommon.addControls fullImage
|
||||||
|
|
||||||
videoControls: $.el 'span',
|
videoControls: $.el 'span',
|
||||||
className: 'video-controls'
|
className: 'video-controls'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user