Fix repaintIfReady command

Can't always use 'this' (some functions call apply without
a context).

[#44621785]