MDL-37023 JavaScript: Correct parsing of block regions

Where a block region consisted of multiple hyphen-separated words, the dock
code was unable to correctly rewrite the name of the class, causing the
layout to be incorrect.