topics
This commit is contained in:
parent
64d9b23561
commit
d72a1e1931
43
app/assets/javascripts/note_files/note_files.js
Normal file
43
app/assets/javascripts/note_files/note_files.js
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
function init_note_upload_fields(note_id){
|
||||||
|
drop = $('#note_'+note_id+' .fileupload').closest(".bottom")
|
||||||
|
|
||||||
|
$('#note_'+note_id+' .fileupload').fileupload({
|
||||||
|
url: $(this).attr("action"),
|
||||||
|
dropZone: drop,
|
||||||
|
autoUpload: true,
|
||||||
|
progressall: function (e, data) {
|
||||||
|
var progress = parseInt(data.loaded / data.total * 100, 10);
|
||||||
|
|
||||||
|
$(this).find('.progress .bar').html(progress + '% téléchargé.');
|
||||||
|
},
|
||||||
|
always: function (e, data) {
|
||||||
|
$(this).find('.progress .bar').html("");
|
||||||
|
},
|
||||||
|
|
||||||
|
drop: function (e, data) {
|
||||||
|
|
||||||
|
$('#note_'+note_id+' .fileupload').closest(".bottom").css("background", "rgb(255, 255, 204)");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(".note .bottom").bind('dragover', function (e) {
|
||||||
|
$(this).css("background", "#B7DF63");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$(".note .bottom").bind('dragleave', function (e) {
|
||||||
|
$(this).css("background", "rgb(255, 255, 204)");
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user