Revert "Remove 'Restart when Opened' option. #904"
This reverts commit 8ab49a22146e6e476fd29ca7b8df65d1aab766d8.
This commit is contained in:
parent
e152e3b1e9
commit
aa7ad6a297
@ -6,6 +6,12 @@ ImageCommon =
|
||||
$.off video, 'volumechange', Volume.change
|
||||
video.muted = true
|
||||
|
||||
rewind: (el) ->
|
||||
if el.nodeName is 'VIDEO'
|
||||
el.currentTime = 0 if el.readyState >= el.HAVE_METADATA
|
||||
else if /\.gif$/.test el.src
|
||||
$.queueTask -> el.src = el.src
|
||||
|
||||
pushCache: (el) ->
|
||||
ImageCommon.cache = el
|
||||
$.on el, 'error', ImageCommon.cacheError
|
||||
|
||||
@ -146,6 +146,7 @@ ImageExpand =
|
||||
ImageCommon.pause el
|
||||
for eventName, cb of ImageExpand.videoCB
|
||||
$.off el, eventName, cb
|
||||
ImageCommon.rewind file.thumb if Conf['Restart when Opened']
|
||||
delete file.fullImage
|
||||
$.queueTask ->
|
||||
# XXX Work around Chrome/Chromium not firing mouseover on the thumbnail.
|
||||
@ -168,6 +169,7 @@ ImageExpand =
|
||||
else if ImageCommon.cache?.dataset.fullID is post.fullID
|
||||
el = file.fullImage = ImageCommon.popCache()
|
||||
$.on el, 'error', ImageExpand.error
|
||||
ImageCommon.rewind el if Conf['Restart when Opened'] and el.id isnt 'ihover'
|
||||
el.removeAttribute 'id'
|
||||
else
|
||||
el = file.fullImage = $.el (if isVideo then 'video' else 'img')
|
||||
|
||||
@ -34,6 +34,9 @@ ImageHover =
|
||||
$.on el, 'error', error
|
||||
el.src = file.url
|
||||
|
||||
if Conf['Restart when Opened']
|
||||
ImageCommon.rewind el
|
||||
ImageCommon.rewind @
|
||||
el.id = 'ihover'
|
||||
$.add Header.hover, el
|
||||
if isVideo
|
||||
|
||||
@ -254,6 +254,10 @@ Config =
|
||||
true
|
||||
'Videos begin playing immediately when opened.'
|
||||
]
|
||||
'Restart when Opened': [
|
||||
false
|
||||
'Restart GIFs and WebMs when you hover over or expand them.'
|
||||
]
|
||||
'Show Controls': [
|
||||
true
|
||||
'Show controls on videos expanded inline.'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user