remove selector string option from Subscription constructor

This commit is contained in:
Mike Greiling 2016-12-01 00:14:12 -06:00
parent eed2de2058
commit 1f6ec18315

View file

@ -2,12 +2,10 @@
(() => {
class Subscription {
constructor(containerSelector) {
this.containerElm = (typeof containerSelector === 'string')
? document.querySelector(containerSelector)
: containerSelector;
constructor(containerElm) {
this.containerElm = containerElm;
const subscribeButton = this.containerElm.querySelector('.js-subscribe-button');
const subscribeButton = containerElm.querySelector('.js-subscribe-button');
if (subscribeButton) {
// remove class so we don't bind twice
subscribeButton.classList.remove('js-subscribe-button');