Set style properties to empty string to clear them, not null. #544
This commit is contained in:
parent
394812b2df
commit
de0d779029
@ -267,7 +267,7 @@ drag = (e) ->
|
|||||||
left = if left < 10
|
left = if left < 10
|
||||||
0
|
0
|
||||||
else if @width - left < 10
|
else if @width - left < 10
|
||||||
null
|
''
|
||||||
else
|
else
|
||||||
left / @screenWidth * 100 + '%'
|
left / @screenWidth * 100 + '%'
|
||||||
|
|
||||||
@ -275,19 +275,19 @@ drag = (e) ->
|
|||||||
top = if top < (10 + @topBorder)
|
top = if top < (10 + @topBorder)
|
||||||
@topBorder + 'px'
|
@topBorder + 'px'
|
||||||
else if @height - top < (10 + @bottomBorder)
|
else if @height - top < (10 + @bottomBorder)
|
||||||
null
|
''
|
||||||
else
|
else
|
||||||
top / @screenHeight * 100 + '%'
|
top / @screenHeight * 100 + '%'
|
||||||
|
|
||||||
right = if left is null
|
right = if left is ''
|
||||||
0
|
0
|
||||||
else
|
else
|
||||||
null
|
''
|
||||||
|
|
||||||
bottom = if top is null
|
bottom = if top is ''
|
||||||
@bottomBorder + 'px'
|
@bottomBorder + 'px'
|
||||||
else
|
else
|
||||||
null
|
''
|
||||||
|
|
||||||
{style} = @
|
{style} = @
|
||||||
style.left = left
|
style.left = left
|
||||||
@ -356,9 +356,9 @@ hover = (e) ->
|
|||||||
threshold = @clientWidth / 2
|
threshold = @clientWidth / 2
|
||||||
threshold = Math.max threshold, @clientWidth - 400 unless @isImage
|
threshold = Math.max threshold, @clientWidth - 400 unless @isImage
|
||||||
[left, right] = if clientX <= threshold
|
[left, right] = if clientX <= threshold
|
||||||
[clientX + 45 + 'px', null]
|
[clientX + 45 + 'px', '']
|
||||||
else
|
else
|
||||||
[null, @clientWidth - clientX + 45 + 'px']
|
['', @clientWidth - clientX + 45 + 'px']
|
||||||
|
|
||||||
{style} = @
|
{style} = @
|
||||||
style.top = top + 'px'
|
style.top = top + 'px'
|
||||||
|
|||||||
@ -329,7 +329,7 @@ Gallery =
|
|||||||
style.minHeight = minHeight + 'px'
|
style.minHeight = minHeight + 'px'
|
||||||
style.minWidth = (width / height * minHeight) + 'px'
|
style.minWidth = (width / height * minHeight) + 'px'
|
||||||
else
|
else
|
||||||
style.minHeight = style.minWidth = null
|
style.minHeight = style.minWidth = ''
|
||||||
|
|
||||||
setDelay: -> Gallery.delay = +@value
|
setDelay: -> Gallery.delay = +@value
|
||||||
|
|
||||||
|
|||||||
@ -74,6 +74,6 @@ Nav =
|
|||||||
if extra > 0
|
if extra > 0
|
||||||
d.body.style.marginBottom = "#{extra}px"
|
d.body.style.marginBottom = "#{extra}px"
|
||||||
else
|
else
|
||||||
d.body.style.marginBottom = null
|
d.body.style.marginBottom = ''
|
||||||
delete Nav.haveExtra
|
delete Nav.haveExtra
|
||||||
$.off d, 'scroll', Nav.removeExtra
|
$.off d, 'scroll', Nav.removeExtra
|
||||||
|
|||||||
@ -135,7 +135,7 @@ Captcha.v1 =
|
|||||||
QR.captcha.load()
|
QR.captcha.load()
|
||||||
|
|
||||||
if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
|
if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
|
||||||
QR.nodes.el.style.top = null
|
QR.nodes.el.style.top = ''
|
||||||
QR.nodes.el.style.bottom = '0px'
|
QR.nodes.el.style.bottom = '0px'
|
||||||
|
|
||||||
destroy: ->
|
destroy: ->
|
||||||
|
|||||||
@ -144,7 +144,7 @@ Captcha.v2 =
|
|||||||
|
|
||||||
fixQRPosition: ->
|
fixQRPosition: ->
|
||||||
if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
|
if QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight
|
||||||
QR.nodes.el.style.top = null
|
QR.nodes.el.style.top = ''
|
||||||
QR.nodes.el.style.bottom = '0px'
|
QR.nodes.el.style.bottom = '0px'
|
||||||
|
|
||||||
setupTextArea: (textarea) ->
|
setupTextArea: (textarea) ->
|
||||||
|
|||||||
@ -203,7 +203,7 @@ QR.post = class
|
|||||||
@showFileData()
|
@showFileData()
|
||||||
else
|
else
|
||||||
@updateFilename()
|
@updateFilename()
|
||||||
@nodes.el.style.backgroundImage = null
|
@nodes.el.style.backgroundImage = ''
|
||||||
unless @file.type in QR.mimeTypes
|
unless @file.type in QR.mimeTypes
|
||||||
@fileError 'Unsupported file type.'
|
@fileError 'Unsupported file type.'
|
||||||
else if /^(image|video)\//.test @file.type
|
else if /^(image|video)\//.test @file.type
|
||||||
@ -299,7 +299,7 @@ QR.post = class
|
|||||||
delete @filesize
|
delete @filesize
|
||||||
@nodes.el.removeAttribute 'title'
|
@nodes.el.removeAttribute 'title'
|
||||||
QR.nodes.filename.removeAttribute 'title'
|
QR.nodes.filename.removeAttribute 'title'
|
||||||
@nodes.el.style.backgroundImage = null
|
@nodes.el.style.backgroundImage = ''
|
||||||
$.rmClass @nodes.el, 'has-file'
|
$.rmClass @nodes.el, 'has-file'
|
||||||
@showFileData()
|
@showFileData()
|
||||||
URL.revokeObjectURL @URL
|
URL.revokeObjectURL @URL
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user