latest changes

This commit is contained in:
Dobie Wollert
2014-12-15 02:36:41 -05:00
parent b35bb3f1d5
commit 966152a631
57 changed files with 6842 additions and 42 deletions

View File

@ -787,4 +787,36 @@ angular.module('biomed.directives', [])
};
}
};
})
.directive('dropzone', function() {
return {
scope: {
dropzone: '=',
existing: '='
},
controller: function($scope, $element, $attrs) {
var config, dropzone;
config = $scope.dropzone;
dropzone = new Dropzone($element[0], config.options);
angular.forEach(config.eventHandlers, function (handler, event) {
dropzone.on(event, handler);
});
$scope.$watch('existing', function() {
var existing = $scope.existing;
console.log(dropzone);
if (existing) {
for (var i = 0; i < existing.length; i++) {
var file = { name: existing[i], size: 0, accepted: true, filename: existing[i] };
dropzone.options.addedfile.call(dropzone, file);
dropzone.options.thumbnail.call(dropzone, file, "http://atlanticbiomedical.com/images/" + existing[i]);
dropzone.files.push(file);
}
}
});
}
};
});