of nliu that is very useful. Recently I found how to show the tree of TOC in right to left mode.
div id="tocDiv" dir="rtl"
where tocDiv is a tag you would attach TOC to.
Secondly in source code Toc.js of tOC widget replace
paddingLeft by paddingRight
(there are 2 such places)