add explicit hide/close button

This commit is contained in:
Ilya Grigorik
2015-05-14 23:42:12 -07:00
parent 878af302c0
commit 9a7cd25d50
2 changed files with 12 additions and 5 deletions

View File

@@ -66,14 +66,18 @@ chrome.extension.sendMessage({}, function(response) {
var fasterButton = document.createElement('button');
var slowerButton = document.createElement('button');
var rewindButton = document.createElement('button');
var hideButton = document.createElement('button');
rewindButton.innerHTML = '«';
fasterButton.textContent = '+';
slowerButton.textContent = '-';
hideButton.textContent = 'x';
hideButton.className = 'tc-hideButton';
controls.appendChild(rewindButton);
controls.appendChild(slowerButton);
controls.appendChild(fasterButton);
controls.appendChild(hideButton);
container.appendChild(speedIndicator);
container.appendChild(controls);
@@ -96,7 +100,7 @@ chrome.extension.sendMessage({}, function(response) {
runAction('faster')
} else if (e.target === rewindButton) {
runAction('rewind')
} else {
} else if (e.target === hideButton) {
container.nextSibling.classList.add('vc-cancelled')
container.remove();
}