add error handler before setting file.src
This commit is contained in:
parent
642fe1b2d5
commit
c8b38a5d11
@ -142,8 +142,10 @@ Gallery =
|
|||||||
elType = 'iframe' if /\.pdf$/.test(@href)
|
elType = 'iframe' if /\.pdf$/.test(@href)
|
||||||
$[if elType is 'iframe' then 'addClass' else 'rmClass'] doc, 'gal-pdf'
|
$[if elType is 'iframe' then 'addClass' else 'rmClass'] doc, 'gal-pdf'
|
||||||
file = $.el elType,
|
file = $.el elType,
|
||||||
src: name.href = @href
|
|
||||||
title: name.download = name.textContent = @title
|
title: name.download = name.textContent = @title
|
||||||
|
$.on file, 'error', ->
|
||||||
|
Gallery.cb.error file, thumb
|
||||||
|
file.src = name.href = @href
|
||||||
|
|
||||||
$.extend file.dataset, @dataset
|
$.extend file.dataset, @dataset
|
||||||
nodes.current.pause?()
|
nodes.current.pause?()
|
||||||
@ -163,9 +165,6 @@ Gallery =
|
|||||||
return if top < 0
|
return if top < 0
|
||||||
|
|
||||||
nodes.thumbs.scrollTop += top
|
nodes.thumbs.scrollTop += top
|
||||||
|
|
||||||
$.on file, 'error', ->
|
|
||||||
Gallery.cb.error file, thumb
|
|
||||||
|
|
||||||
image: (e) ->
|
image: (e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user