summaryrefslogtreecommitdiff
path: root/assets/js/components
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-14 18:24:24 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-14 18:24:24 -0500
commit513aefdb2c092b687c567c62e6e3d70b9bcea4f4 (patch)
tree4b3794acadfa13e8d30218a8d547d63c14005fd5 /assets/js/components
parentefc1e856128a0b8e1c9170c16bd242b83fd884ce (diff)
Improve screenshot component teardown
Diffstat (limited to 'assets/js/components')
-rw-r--r--assets/js/components/screenshot.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/assets/js/components/screenshot.js b/assets/js/components/screenshot.js
index 8f40487d..069b3396 100644
--- a/assets/js/components/screenshot.js
+++ b/assets/js/components/screenshot.js
@@ -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);