'use strict';
|
|
define(['app'],
|
function (app) {
|
|
app.directive('fileUploadProgress', ["$log", "$rootScope",
|
function ($log, $rootScope) {
|
return {
|
restrict : 'AE',
|
templateUrl : "custom_components/file-upload-progress/file-upload-progress.html",
|
link : function ($scope, $element, $attrs) {
|
|
/*$scope.vm = {
|
display : false, // 표시 여부
|
displayType : "client",
|
fileName : "", // 파일 명
|
process : "0%", // 진행률
|
totalFileCount : 0, // 전체 업로드 개수
|
uploadFileCount : 0 // 진행중인 업로드 파일 개수
|
};*/
|
// 파입 업로드 진행률 표시
|
$scope.$on("displayFileUpload", function (event, args) {
|
if ($rootScope.isDefined(args.clientFileCount)) {
|
$("#client-file-upload").show();
|
$("#client-toast-progress").text(args.clientProgress);
|
$("#client-file-title").text(args.clientFileCount);
|
}
|
else {
|
$("#client-toast-progress").text("0%");
|
$("#client-file-title").text("");
|
|
$("#client-file-upload").hide();
|
}
|
|
if ($rootScope.isDefined(args.serverFileName)) {
|
$("#server-file-upload").show();
|
$("#server-toast-progress").text(args.serverProgress);
|
$("#server-file-name").text(args.serverFileName);
|
$("#uploadFileCount").text(args.uploadFileCount);
|
$("#totalFileCount").text(args.totalFileCount);
|
}
|
else {
|
$("#server-toast-progress").text("0%");
|
$("#server-file-name").text("");
|
$("#uploadFileCount").text(0);
|
$("#totalFileCount").text(0);
|
$("#server-file-upload").hide();
|
}
|
|
|
if (args.display) {
|
$(".file-upload-process").show();
|
}
|
else {
|
$(".file-upload-process").hide();
|
}
|
})
|
}
|
}
|
}])
|
});
|