--- /dev/null
+(function() {
+ "use strict";
+ angular.module("nero.app")
+ .controller("ViewerController", ViewerController);
+
+ ViewerController.$inject = ["$uibModalInstance", "$timeout", "parameters"];
+
+ /*
+ Angular viewer controller
+
+ parameters :
+ - attachment : Attachment file to display (Object)
+ - idProperties : Object containing ids info depending on portlet (used for conversion progress bar)
+ */
+ function ViewerController($uibModalInstance, $timeout, parameters) {
+ var vm = this;
+
+ vm.attachment = parameters.attachment;
+ vm.title = vm.attachment.fileName;
+ vm.idProperties = parameters.idProperties;
+ vm.closeModal = closeModal;
+
+ /**
+ Set viewer window resizable and draggable
+ */
+ $timeout(function () {
+ var modalWindow = $(".modal-viewer .modal-content");
+ modalWindow.resizable({
+ alsoResize: ".modal-viewer .nero-modal-body",
+ minHeight: modalWindow[0].offsetHeight,
+ minWidth: modalWindow[0].offsetWidth
+ });
+
+ $(".modal-viewer").draggable();
+ });
+
+
+ /**
+ On close button click dismiss the window
+ */
+ function closeModal() {
+ $uibModalInstance.dismiss("cancel");
+ };
+
+ }
+})();