Improve screenshot component teardown

This commit is contained in:
Frederic Guillot 2017-01-14 18:24:24 -05:00
parent efc1e85612
commit 513aefdb2c
2 changed files with 5 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -60,10 +60,8 @@ KB.component('screenshot', function (containerElement) {
}
function destroy() {
if (pasteCatcher !== null) {
document.body.removeChild(pasteCatcher);
} else if (document.getElementById('screenshot-pastezone')) {
document.body.removeChild(document.getElementById('screenshot-pastezone'));
if (KB.exists('#screenshot-pastezone')) {
KB.find('#screenshot-pastezone').remove();
}
document.removeEventListener('click', setFocus);