From fd47d271e4a2244cdc3cea0f7d485d11349583e2 Mon Sep 17 00:00:00 2001
From: satish <satish.dvnk@vtiger.com>
Date: Tue, 27 Feb 2018 20:38:27 +0530
Subject: [PATCH] Fixes #643 - vt7: Can't download attachments to Documents.
 White Screen of Death!

---
 layouts/v7/modules/Vtiger/resources/Vtiger.js | 31 +++++++++++--------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/layouts/v7/modules/Vtiger/resources/Vtiger.js b/layouts/v7/modules/Vtiger/resources/Vtiger.js
index 09019627e..bb10d576c 100644
--- a/layouts/v7/modules/Vtiger/resources/Vtiger.js
+++ b/layouts/v7/modules/Vtiger/resources/Vtiger.js
@@ -21,20 +21,25 @@ Vtiger.Class('Vtiger_Index_Js', {
 	 * @returns {undefined}
 	 */
 	previewFile: function (e, recordId,attachmentId) {
-		e.stopPropagation();
-		if (recordId) {
-			var params = {
-				module: 'ModComments',
-				view: 'FilePreview',
-				record: recordId,
-				attachmentid: attachmentId
+        e.stopPropagation();
+        if (recordId) {
+            var params = {
+                module: 'ModComments',
+                view: 'FilePreview',
+                record: recordId,
+                attachmentid: attachmentId
+            };
+			var modalParams = {
+				cb : function(modalContainer){
+					modalContainer.find('.viewer').zoomer();
+				},
+				'ignoreScroll' : true
 			};
-			app.request.post({data:params}).then(function(err, res){
-				app.helper.showModal(res);
-				jQuery('.filePreview .preview-area').height(jQuery(window).height()-143);
-			});
-		}
-	},
+            app.request.post({data: params}).then(function (err, res) {
+                app.helper.showModal(res, modalParams);
+            });
+        }
+    },
 
 	/**
 	 * Function to show email preview in popup
-- 
GitLab