Tiny optimization to avoid calling QR.status() multiple times when closing the QR.
This commit is contained in:
parent
dc8551bcf1
commit
8a9df9d15a
@ -74,8 +74,8 @@ QR =
|
|||||||
QR.cleanNotifications()
|
QR.cleanNotifications()
|
||||||
d.activeElement.blur()
|
d.activeElement.blur()
|
||||||
$.rmClass QR.nodes.el, 'dump'
|
$.rmClass QR.nodes.el, 'dump'
|
||||||
for i in QR.posts
|
for post in QR.posts.splice 0, QR.posts.length, new QR.post true
|
||||||
QR.posts[0].rm()
|
post.delete()
|
||||||
QR.cooldown.auto = false
|
QR.cooldown.auto = false
|
||||||
QR.status()
|
QR.status()
|
||||||
focusin: ->
|
focusin: ->
|
||||||
@ -494,15 +494,17 @@ QR =
|
|||||||
@select() if select
|
@select() if select
|
||||||
@unlock()
|
@unlock()
|
||||||
rm: ->
|
rm: ->
|
||||||
$.rm @nodes.el
|
@delete()
|
||||||
index = QR.posts.indexOf @
|
index = QR.posts.indexOf @
|
||||||
if QR.posts.length is 1
|
if QR.posts.length is 1
|
||||||
new QR.post true
|
new QR.post true
|
||||||
else if @ is QR.selected
|
else if @ is QR.selected
|
||||||
(QR.posts[index-1] or QR.posts[index+1]).select()
|
(QR.posts[index-1] or QR.posts[index+1]).select()
|
||||||
QR.posts.splice index, 1
|
QR.posts.splice index, 1
|
||||||
URL.revokeObjectURL @URL
|
|
||||||
QR.status()
|
QR.status()
|
||||||
|
delete: ->
|
||||||
|
$.rm @nodes.el
|
||||||
|
URL.revokeObjectURL @URL
|
||||||
lock: (lock=true) ->
|
lock: (lock=true) ->
|
||||||
@isLocked = lock
|
@isLocked = lock
|
||||||
return unless @ is QR.selected
|
return unless @ is QR.selected
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user