diff options
Diffstat (limited to 'assets/js/components')
-rw-r--r-- | assets/js/components/modal.js | 2 | ||||
-rw-r--r-- | assets/js/components/screenshot.js | 9 | ||||
-rw-r--r-- | assets/js/components/submit-buttons.js | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/assets/js/components/modal.js b/assets/js/components/modal.js index f0867289..458cc526 100644 --- a/assets/js/components/modal.js +++ b/assets/js/components/modal.js @@ -4,7 +4,7 @@ return e.target.parentNode.getAttribute('href'); } - return e.target.getAttribute('href') + return e.target.getAttribute('href'); } KB.onClick('.js-modal-large', function (e) { diff --git a/assets/js/components/screenshot.js b/assets/js/components/screenshot.js index a110f9b1..4cab31a1 100644 --- a/assets/js/components/screenshot.js +++ b/assets/js/components/screenshot.js @@ -2,6 +2,10 @@ KB.component('screenshot', function (containerElement) { var pasteCatcher = null; var inputElement = null; + function onFileLoaded(e) { + createImage(e.target.result); + } + function onPaste(e) { // Firefox doesn't have the property e.clipboardData.items (only Chrome) if (e.clipboardData && e.clipboardData.items) { @@ -16,10 +20,7 @@ KB.component('screenshot', function (containerElement) { // Get the image as base64 data var reader = new FileReader(); - reader.onload = function (event) { - createImage(event.target.result); - }; - + reader.onload = onFileLoaded; reader.readAsDataURL(blob); } } diff --git a/assets/js/components/submit-buttons.js b/assets/js/components/submit-buttons.js index b6ad3769..24d46855 100644 --- a/assets/js/components/submit-buttons.js +++ b/assets/js/components/submit-buttons.js @@ -85,7 +85,7 @@ KB.component('submit-buttons', function (containerElement, options) { if (KB.modal.isOpen()) { formActionElementBuilder .text(' ' + options.orLabel + ' ') - .add(KB.dom('a').attr('href', '#').click(onCancel).text(options.cancelLabel).build()) + .add(KB.dom('a').attr('href', '#').click(onCancel).text(options.cancelLabel).build()); } formActionElement = formActionElementBuilder.build(); |