mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03:00
Give the view a chance to update before presenting next dialog
This commit is contained in:
parent
f0398f2331
commit
e4bf73b41c
@ -150,11 +150,13 @@ describe "the `atom` global", ->
|
||||
callbacks = @argsForCall[0][2]
|
||||
@reset()
|
||||
callbacks[labels.indexOf(buttonText)]()
|
||||
advanceClock 50
|
||||
|
||||
atom.sendMessageToBrowserProcess.simulatePathSelection = (path) ->
|
||||
callback = @argsForCall[0][2]
|
||||
@reset()
|
||||
callback(path)
|
||||
advanceClock 50
|
||||
|
||||
it "only presents one native dialog at a time", ->
|
||||
confirmHandler = jasmine.createSpy("confirmHandler")
|
||||
|
@ -131,7 +131,8 @@ _.extend atom,
|
||||
@pendingModals.push([]) # prioritize any modals presented during dismiss callback
|
||||
fn?(args...)
|
||||
@presentingModal = false
|
||||
@presentModal(fn) if fn = @shiftPendingModal()
|
||||
if fn = @shiftPendingModal()
|
||||
_.delay (=> @presentModal(fn)), 50 # let view update before next dialog
|
||||
|
||||
pushPendingModal: (fn) ->
|
||||
# pendingModals is a stack of queues. enqueue to top of stack.
|
||||
|
Loading…
Reference in New Issue
Block a user