Teddy does this after going potty! I call it his dance. He does it really loud (scratching) when he uses the pad to tell me he has done his business.
We cheer for Teddy and sometimes he makes the dance really jazzy and kicks some more.
Max learned from Teddy and does it outdoors to celebrate.