mirror of
https://github.com/tubearchivist/browser-extension.git
synced 2024-11-22 11:40:13 +00:00
rename channelSubButton
This commit is contained in:
parent
114548d362
commit
4112501900
@ -159,8 +159,8 @@ function buildChannelButton(channelContainer) {
|
|||||||
let channelHandle = getChannelHandle(channelContainer);
|
let channelHandle = getChannelHandle(channelContainer);
|
||||||
let buttonDiv = buildChannelButtonDiv();
|
let buttonDiv = buildChannelButtonDiv();
|
||||||
|
|
||||||
let subLink = buildChannelSubLink(channelHandle);
|
let channelSubButton = buildChannelSubButton(channelHandle);
|
||||||
buttonDiv.appendChild(subLink);
|
buttonDiv.appendChild(channelSubButton);
|
||||||
|
|
||||||
let spacer = buildSpacer();
|
let spacer = buildSpacer();
|
||||||
buttonDiv.appendChild(spacer);
|
buttonDiv.appendChild(spacer);
|
||||||
@ -199,27 +199,27 @@ function buildChannelButtonDiv() {
|
|||||||
return buttonDiv;
|
return buttonDiv;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildChannelSubLink(channelHandle) {
|
function buildChannelSubButton(channelHandle) {
|
||||||
let subLink = document.createElement('span');
|
let channelSubButton = document.createElement('span');
|
||||||
subLink.innerText = 'Subscribe';
|
channelSubButton.innerText = 'Subscribe';
|
||||||
subLink.title = `TA Subscribe: ${channelHandle}`;
|
channelSubButton.title = `TA Subscribe: ${channelHandle}`;
|
||||||
subLink.setAttribute('data-id', channelHandle);
|
channelSubButton.setAttribute('data-id', channelHandle);
|
||||||
subLink.setAttribute('data-type', 'channel');
|
channelSubButton.setAttribute('data-type', 'channel');
|
||||||
|
|
||||||
subLink.addEventListener('click', e => {
|
channelSubButton.addEventListener('click', e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log(`subscribe to: ${channelHandle}`);
|
console.log(`subscribe to: ${channelHandle}`);
|
||||||
sendUrl(channelHandle, 'subscribe', subLink);
|
sendUrl(channelHandle, 'subscribe', channelSubButton);
|
||||||
});
|
});
|
||||||
subLink.addEventListener('mouseover', () => {
|
channelSubButton.addEventListener('mouseover', () => {
|
||||||
checkChannelSubscribed(channelHandle);
|
checkChannelSubscribed(channelHandle);
|
||||||
});
|
});
|
||||||
Object.assign(subLink.style, {
|
Object.assign(channelSubButton.style, {
|
||||||
padding: '5px',
|
padding: '5px',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
});
|
});
|
||||||
|
|
||||||
return subLink;
|
return channelSubButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkChannelSubscribed(channelHandle) {
|
function checkChannelSubscribed(channelHandle) {
|
||||||
|
Loading…
Reference in New Issue
Block a user