Commit 1f6ec183 authored by Mike Greiling's avatar Mike Greiling

remove selector string option from Subscription constructor

parent eed2de20
...@@ -2,12 +2,10 @@ ...@@ -2,12 +2,10 @@
(() => { (() => {
class Subscription { class Subscription {
constructor(containerSelector) { constructor(containerElm) {
this.containerElm = (typeof containerSelector === 'string') this.containerElm = containerElm;
? document.querySelector(containerSelector)
: containerSelector;
const subscribeButton = this.containerElm.querySelector('.js-subscribe-button'); const subscribeButton = containerElm.querySelector('.js-subscribe-button');
if (subscribeButton) { if (subscribeButton) {
// remove class so we don't bind twice // remove class so we don't bind twice
subscribeButton.classList.remove('js-subscribe-button'); subscribeButton.classList.remove('js-subscribe-button');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment