This method is copied form [baseview.js](https://github.com/edx/edx-platform/blob/anton/download-handout/cms/static/js/views/baseview.js#L68) and selector is changed a bit. `templateSelector` was added for better readability and to be in 80 characters rule.