From 122e0c96763c9dec25e15d889a5272c5d2324115 Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Fri, 1 Dec 2017 14:31:49 -0800 Subject: [PATCH] Fix: Properly bind download button in PreviewErrorViewer (#527) --- src/lib/viewers/error/PreviewErrorViewer.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lib/viewers/error/PreviewErrorViewer.js b/src/lib/viewers/error/PreviewErrorViewer.js index e5ab737fc..0f8ed67de 100644 --- a/src/lib/viewers/error/PreviewErrorViewer.js +++ b/src/lib/viewers/error/PreviewErrorViewer.js @@ -7,11 +7,17 @@ import './PreviewError.scss'; class PreviewErrorViewer extends BaseViewer { /** - * [constructor] - * - * @param {string|HTMLElement} container - The container - * @param {Object} options - Some options - * @return {Error} Error instance + * @inheritdoc + */ + constructor(options) { + super(options); + + // Bind context for handler + this.download = this.download.bind(this); + } + + /** + * @inheritdoc */ setup() { // Call super() first to set up common layout