Don’t resolve a Promise in idle()
authorTim Düsterhus <duesterhus@woltlab.com>
Sun, 25 Nov 2018 20:49:01 +0000 (21:49 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 29 Nov 2018 14:42:23 +0000 (15:42 +0100)
commit346d379224cf5511d832507fe01f7a9aa5179f30
tree6f8499ef5c283381beaa96b0a0a57aaa153ade5d
parenta7acf9ec467b0c6baa627e733602e454bb41d9eb
Don’t resolve a Promise in idle()

The `.then` will be executed in the next iteration of the event loop
and the browser might not be idle any longer when this happens.

Instead use a function that “idleify”s a function. When the returned function
is called it returns a `Promise` and synchronously executes the function when
the browser is idle.

see #2752
wcfsetup/install/files/js/WoltLabSuite/Core/Bbcode/Code.js