Commit 02aadecd authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Add view of selected files

parent 95b75523
......@@ -244,6 +244,18 @@ background-color:#F7F7F9;
background-image: url("images/add_files-hover.svg");
}
.fileDialogDialog .ui-dialog-buttonpane .nbFiles {
cursor: pointer;
}
.fileDialogDialog .ui-dialog-buttonpane .nbFiles:hover {
text-decoration: underline;
}
.labelBlock {
display: block;
}
@-moz-keyframes fadeG{
0%{
background-color:#000000}
......
......@@ -71,8 +71,54 @@
}
}]
});
$(".ui-dialog-buttonpane").append("<div class='nbFiles'>")
$(".nbFiles").html("0 files selected.")
$(".ui-dialog-buttonpane").append("<div class='nbFiles'>");
$(".nbFiles").html("0 files selected.");
$(".fileDialogDialog .ui-dialog-buttonpane .nbFiles").off("click").on("click", function() {
if (selectedFiles.length > 0) {
$("#filesSelected").remove();
$("body").append("<div id='filesSelected'>");
var selectedHtml = "";
for (var f = 0; f < selectedFiles.length; f++) {
var file = selectedFiles[f];
selectedHtml += "<label rel='" + file + "' class='labelBlock'><input rel='" + file + "' type='checkbox'/> " + file + "</label>";
}
$("#filesSelected").html(selectedHtml);
$("#filesSelected").dialog({
title: "You select these files",
width: 430,
closeText: null,
dialogClass: "filesSelectedDialog",
buttons: [
{
text: "Check all",
click: function() {
$("#filesSelected input[type=checkbox]").prop("checked", true);
}
}, {
text: "Uncheck all",
click: function () {
$("#filesSelected input[type=checkbox]").prop("checked", false);
}
}, {
text: "Remove",
click: function () {
$("#filesSelected input[type=checkbox]:checked").each(function() {
var file = $(this).attr("rel");
$("#fileDialog a[rel='" + file + "']").parent("li").removeClass("selected");
$("#fileDialog a[rel='" + file + "']").parent("li").find("input[type=checkbox]").prop("checked", false);
$("#filesSelected label[rel='" + file + "']").remove();
})
}
}, {
text: "Close",
click: function () {
$(this).dialog("close");
}
}
]
});
}
})
}
})(window.JflowBrowser = window.JflowWfformRules || {}, window.jQuery);
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment