#117: more logs + possible fix

This commit is contained in:
bgamard 2017-11-03 11:13:50 +01:00
parent 18f37ec2a8
commit a055b3ff5c
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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]);
});
});