You can use the original (slightly modified) code on 2.3. It should work fine.
https://github.com/dsv-su/moodle-mod_labelcollapsed
Also, I am currently trying to push it to the Moodle Core as an add-on to Label resource, feel free to check it out: https://tracker.moodle.org/browse/MDL-43336