diff --git a/src/vitis/client/javascript/externs/formReader/component/file_picker/file_picker.js b/src/vitis/client/javascript/externs/formReader/component/file_picker/file_picker.js index 6303a911942d07a05afe9c7f35b5bf0749fc4459..6de54f6e52ed6d4b482c6f313f2d32f10ad676ae 100644 --- a/src/vitis/client/javascript/externs/formReader/component/file_picker/file_picker.js +++ b/src/vitis/client/javascript/externs/formReader/component/file_picker/file_picker.js @@ -28,7 +28,6 @@ nsVitisComponent.FilePickerDirective = function ($timeout, $translate, propertie 'sFormDefinitionName': '=appFormDefName', 'oFormValues': '=appFormVal' }, - // controller: 'AppFilePickerController', controllerAs: 'ctrl', templateUrl: window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '') + "/" + sessionStorage["appEnv"] + '/javascript/externs/formReader/component/file_picker/file_picker.html', compile: function (element, attributes) { @@ -89,18 +88,6 @@ nsVitisComponent.FilePickerDirective = function ($timeout, $translate, propertie scope["oFormValues"][scope["sFormDefinitionName"]][element[0].name] = oFileList; }, false); - // Passage de paramètres de définition du champ d'upload ? - // var oOptions = { - // "showPreview": false, - // "showRemove": false, - // "showUpload": false, - // "allowedFileTypes": ['image'] - // }; - // oOptions["mainClass"] = "input-file-" + scope["oFormDefinition"][scope["sFormDefinitionName"]]["input_size"]; - // - // // Langue. - // if (propertiesSrvc["language"] != "en") - // oOptions["language"] = propertiesSrvc["language"]; // Intégration du plugin "bootstrap-fileinput" dans tous les champ d'upload de fichiers. setTimeout(function () { @@ -157,7 +144,11 @@ nsVitisComponent.FilePickerDirective = function ($timeout, $translate, propertie return bIsFilePresent; } - + /** + * Remove the given image + * @param {object} oImage + * @export + */ scope['removeImage'] = function(oImage) { console.log("removeImage: ", oImage); @@ -172,7 +163,11 @@ nsVitisComponent.FilePickerDirective = function ($timeout, $translate, propertie $(oInput).click(); } - + /** + * Show the given image on a modal + * @param {object} oImage + * @export + */ scope['showImageModal'] = function(oImage) { var dialog = bootbox.dialog({ title: oImage['name'], @@ -219,22 +214,3 @@ nsVitisComponent.FilePickerDirective = function ($timeout, $translate, propertie }; }; formReader.module.directive('appFilePicker', nsVitisComponent.FilePickerDirective); - -// /** -// * FilePicker Controller -// * @param {type} $scope -// * @param {type} $log -// * @returns {nsVitisComponent.FilePickerController} -// * @ngInject -// */ -// nsVitisComponent.FilePickerController = function ($scope, $log) { -// $log.info("FilePickerController"); -// var this_ = this; -// -// this.$log_ = $log; -// this.$scope_ = $scope; -// -// console.log("$scope: ", $scope); -// -// }; -// formReader.module.controller('AppFilePickerController', nsVitisComponent.FilePickerController);