From 94976bbd4882dde43a3070c2b34ecc77e11b8468 Mon Sep 17 00:00:00 2001 From: Mark Lise Date: Tue, 25 Apr 2017 08:10:26 -0700 Subject: [PATCH] EPIC-893: Remove unecessary logic for previewer, changing fetch to open in _blank window. --- .../directives/documents.manager.directive.js | 56 +------------------ .../client/views/document-manager.html | 4 +- 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/modules/documents/client/directives/documents.manager.directive.js b/modules/documents/client/directives/documents.manager.directive.js index 73cf65ac7..9f9ec856f 100644 --- a/modules/documents/client/directives/documents.manager.directive.js +++ b/modules/documents/client/directives/documents.manager.directive.js @@ -208,60 +208,8 @@ angular.module('documents') }; self.dblClick = function(doc){ - /* - If user can not read the document (BG: I'm not sure this is possible) then show an alert to say - "You can not read this document" (BG: someone needs to review the text) - Else (user can read file) - If the doc is a pdf then open it with the pdf viewer - Else show a confirmation dialog to offer the user can download the file. - If user selects yes then download the file. - Else no op - */ - if(!doc.userCan.read) { - AlertService.success('You can not have access to read this document.'); - return; - } - if(doc.internalMime === 'application/pdf') { - openPDF(doc); - return; - } - // $filter bytes is filterBytes in documents.client.controllers.js - var size = $filter('bytes')(doc.internalSize, 2); - var msg = 'Confirm download of: ' + doc.displayName + ' (' + size + ')'; - - var scope = { - titleText: doc.displayName, - confirmText: msg, - confirmItems: undefined, - okText: 'OK', - cancelText: 'Cancel', - onOk: downLoadFile, - onCancel: cancelDownload, - okArgs: doc - }; - ConfirmService.confirmDialog(scope); - return; - - function downLoadFile(doc) { - var pdfURL = window.location.protocol + "//" + window.location.host + "/api/document/" + doc._id + "/fetch"; - window.open(pdfURL, "_self"); - return Promise.resolve(true); - } - function cancelDownload() { - return Promise.resolve(); - } - function openPDF(doc){ - var modalDocView = $modal.open({ - resolve: { - pdfobject: { _id: doc._id } - }, - templateUrl: 'modules/documents/client/views/partials/pdf-viewer.html', - controller: 'controllerModalPdfViewer', - controllerAs: 'pdfViewer', - windowClass: 'document-viewer-modal' - }); - modalDocView.result.then(function () {}, function () {}); - } + var pdfURL = window.location.protocol + "//" + window.location.host + "/api/document/" + doc._id + "/fetch"; + window.open(pdfURL, "_blank"); }; self.checkDir = function(doc) { diff --git a/modules/documents/client/views/document-manager.html b/modules/documents/client/views/document-manager.html index 79ba37def..ff2dda56f 100644 --- a/modules/documents/client/views/document-manager.html +++ b/modules/documents/client/views/document-manager.html @@ -273,7 +273,7 @@