diff --git a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js index b667c2bc..cd6a32cb 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/document/DocumentEdit.js @@ -3,7 +3,7 @@ /** * Document edition controller. */ -angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $q, $http, $state, $stateParams, Restangular) { +angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $q, $http, $state, $stateParams, Restangular, $translate) { // Alerts $scope.alerts = []; @@ -120,7 +120,7 @@ angular.module('docs').controller('DocumentEdit', function($rootScope, $scope, $ }); }; - if (_.size($scope.newFiles) == 0) { + if ($scope.newFiles.length === 0) { navigateNext(); } else { $scope.fileIsUploading = true; diff --git a/docs-web/src/main/webapp/src/app/docs/directive/File.js b/docs-web/src/main/webapp/src/app/docs/directive/File.js index 1475755e..974ff98f 100644 --- a/docs-web/src/main/webapp/src/app/docs/directive/File.js +++ b/docs-web/src/main/webapp/src/app/docs/directive/File.js @@ -12,6 +12,8 @@ angular.module('docs').directive('file', function() { link: function(scope, element, attr, ctrl) { element.bind('change', function() { scope.$apply(function() { + console.log('is multiple?', attr.multiple); + console.log('setting file directive value', attr.multiple ? element[0].files : element[0].files[0]); attr.multiple ? ctrl.$setViewValue(element[0].files) : ctrl.$setViewValue(element[0].files[0]); }); });